I\'m writing a simple file for one of my classes that is a simple linked list activity and I need to sort a linked list.
This is my source code so far:
/
MByD already pointed out the problem (my upvote for you, MByD), so with that addressed, I'd like to contribute some advice.
Sorting is one of the problems that have been tackled over, and over, and over and over in the history of computer science. There's an excellent Wikipedia article with an index and comparison of tons of sorting algorithms. Pick a few and learn how they work! Reverse-engineering (sort of) algorithms is a great way to improve your own skills.
Try for example bubble sort, insertion sort and quick sort.
Cheers!