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

Explain set interface?

564


What is dynamic array in excel?

450


What do you mean by tree edge?

523


What is two-dimensional array?

514


Differentiate stack from array?

509






What is the Role of push() and pop() method?

522


What is subtree?

524


What type of variable is age?

472


How to reverse a singly linked list?

522


What do you mean by Logical Error

553


Define right-in threaded tree?

541


How many parts are there in a declaration statement?

533


What is data structure what is need of it?

474


How would you check if a binary tree is BST or not ? Write a program.

509


Who invented quicksort?

502