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

If you do not initialize an array what will happen?

0 Answers  


What is time complexity of bubble sort?

0 Answers  


What is sorting rule in shapes?

0 Answers  


Is array of data structure?

0 Answers  


What is a priority queue?

0 Answers  


Is null allowed in list?

0 Answers  


What is the need for extendible hashing?

0 Answers  


Define degree of the node?

0 Answers  


Write a program to reverse a link list.

0 Answers   iNautix,


How will you sort the elements of array in descending order?

0 Answers   Wipro,


Does arraylist have index?

0 Answers  


What is difference between hashmap and linkedhashmap?

0 Answers  


Categories