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

What is the difference between Array and LinkedList?

0 Answers  


Explain the common uses of tree database.

0 Answers  


What is queue in data structure?

0 Answers  


How do you find the index of an element in an arraylist?

0 Answers  


What is array and its types in data structure?

0 Answers  






Which sorting is stable?

0 Answers  


What are the goals of data structure?

0 Answers  


What is the use of sorting the data?

0 Answers  


Is array a linked list?

0 Answers  


Can we sort hashmap?

0 Answers  


what is a balanced tree.

0 Answers  


What is the average number of comparisons needed in a sequential search to determine the position of an element in an array of 100 elements, if the elements are ordered from largest to smallest?

19 Answers   ABB, SDE,


Categories