A list is ordered from smaller to largest when a sort is
called. Which sort would take the longest time to execute?

Answer Posted / uma sankar pradhan

selection sort,quick sort,bubble sort
(all will take the same time and its time complexity is of
the order of n^2)
the time complexity for insertion sort when the list is
ordered from smaller to larger is O(n)
the time complexity for merge sort irrespective of the
order of the elements is O(nlogn)

Is This Answer Correct ?    16 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can we extend an array after initialization?

582


Can you list out the areas in which data structures are applied extensively?

631


Describe linear probing with an example.

606


Is hashmap an object?

504


List the data structures which are used in rdbms, network data modal, and hierarchical data model.

520






Which time complexity is best?

492


What are the complexity of binary search?

453


Write the recursive c function to count the number of nodes present in a binary tree.

487


What is difference between treeset hashset linkedhashset?

444


What are the applications of stack?

501


Why is data structure important?

537


What do you mean by shortest path?

541


What are the different binary tree traversal techniques?

606


How do you assign an address to an element of a pointer array ?

516


What is merge sort and how it works?

496