Linked list sorting in C

前端 未结 5 753
自闭症患者
自闭症患者 2021-01-25 06:48

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:

/         


        
5条回答
  •  太阳男子
    2021-01-25 07:31

    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!

提交回复
热议问题