How would you sort a linked list?

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a Queue? Explain its operation with example?

690


What is difference between capacity and size of arraylist?

779


How does the bubble sort work?

689


Explain extended binary tree.

689


What do you mean by garbage collection?

692






What type of algorithm is binary search?

622


Which is better merge or quick sort?

723


How do I rearrange rows in numbers?

633


What is a spanning tree?does the minimum spanning tree of a graph give the shortest distance between any 2 specified nodes?

657


Define a full binary tree ?

705


What are the advantages of sorting and filtering data?

659


Explain the most efficient method to reverse a linked list?

623


What are doubly linked lists?

747


What is stack in geography?

607


What are the advantages of data structure?

699