here is LinkedList class I implemented using c++ templates. also I implemented reverse and sorting linked list by merge sort
template <class T>
void LinkedList<T>::reverseList()
{
Node<T> *curr = head, *prev = head, *save = NULL;
while (curr)
{
save = curr->next;
curr->next = prev;
prev = curr;
curr = save;
}
head->next = NULL;
head = prev;
}
https://code.google.com/p/medicine-cpp/source/browse/trunk/cpp/ds/LinkedList.cpp