How would you sort a linked list?

Answers were Sorted based on User's Feedback



How would you sort a linked list?..

Answer / touchriverian

using merge sort.

http://www.chiark.greenend.org.uk/~sgtatham/algorithms/listsort.html

Is This Answer Correct ?    9 Yes 3 No

How would you sort a linked list?..

Answer / ashok

there is no answer

Is This Answer Correct ?    2 Yes 1 No

How would you sort a linked list?..

Answer / ramesh

I think insertion sort will perform better

Is This Answer Correct ?    3 Yes 3 No

How would you sort a linked list?..

Answer / sdfg

write an insert in order function where it traverse the list until it finds a greater element and put it before it.
create a new list and insert all items in the old list to the new list using the InsertInOrder function

Is This Answer Correct ?    0 Yes 0 No

How would you sort a linked list?..

Answer / deepak pareek

I THINK....selection sort is the better way to sort the
link list.

Is This Answer Correct ?    1 Yes 2 No

Post New Answer

More Data Structures Interview Questions

Why concurrenthashmap is fail safe?

0 Answers  


What is the meaning of anonymous array? Explain with an example?

0 Answers  


Explain what is B-tree?

0 Answers   BPL,


Suppose in an integer array, there is 1 to 100 number, out of one is duplicate, how to find?

0 Answers  


Should I use hashmap or hashtable?

0 Answers  






Are duplicates allowed in hashmap?

0 Answers  


What is difference between list and set?

0 Answers  


What is a subtree in data structures?

0 Answers  


How do you insert a new item in a binary search tree?

0 Answers  


Which is the best book for data structures and algorithms?

0 Answers  


Why quicksort is faster than merge sort?

0 Answers  


What is binary tree give example?

0 Answers  


Categories