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 ? | 17 Yes | 2 No |
Post New Answer View All Answers
What do you mean by selection sort?
Define tree edge?
What does arrays tostring do?
What is difference between stack and queue?
What is meant by heap sort?
Describe avl tree or height balanced binary search tree.
Is merge sort better than quick?
What are the four characteristics of algorithms?
How many types of data structures are used?
What are the pre-requisite for the collection to perform binary search?
What are the types of queues?
List the abstract operations in the set?
What are the tasks performed during postorder traversal?
What is the complexity of arrays sort?
What do you know about different sorting algorithms?