sorting a linked list

few
Last edited on
Approach:
Use any sorting algo. Try Bubble sort. Read bout it first using google.
Compare the data of two nodes. If data in first node is greater than that in second, call the function(you will need to make it) to interchange their data. If their n nodes you will have to traverse the linekd list n-1 time to make it fully sorted.
I'm not too sure how to begin, though. While I understand bubble sorting, its boggling my mind on how to apply it at the same time as linked lists
closed account (D80DSL3A)
@NeoSeeker. Sorry you gave up? I saw your thread this morning and was looking forward to replying after work (which is now). I just got my own linked list sorting functions working well.
What does "few" mean?
Topic archived. No new replies allowed.