bool LinkedList::insertEnd(T item)

{

Node* current;

current = first;

if ( current != NULL )

{ // List not empty

while (current->next != 0)

{

current = current->next;

}

current->next = new Node;

current = current->next;

}

else

{ // List empty

// Alternatively, you could call "insertStart(item)" here rather than these two ines.

current = new Node;

first = current;

}

current->value = item;

current->next = 0;

}

Also, if you gave Node a constructor that set next to NULL and took item as a parameter to initialize value, you could have code like this:

bool LinkedList::insertEnd(T item)

{

Node* current;

current = first;

if ( current != NULL )

{

while (current->next != 0)

{

current = current->next;

}

current->next = new Node(item);

current = current->next;

}

else

{

// Alternatively, you could call "insertStart(item)" here rather than these two ines.

current = new Node(item);

first = current;

}

}

And finally, to facilitate inserting at the end, you could keep track of the end node:

bool LinkedList::insertEnd(T item)

{

if ( last != NULL )

{

last->next = new Node(item);

last = last->next;

}

else

{

last = new Node(item);

first = last;

}

}

This of course adds a little extra code to "insertStart" and any deletion methods.