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 is the difference between arraylist and linkedlist?
Why is tuple immutable?
Explain linear linked implementation of Stack and Queue?
How can I search for data in a linked list?
Write an algorithm to show the postfix expression with the input given as : a b + c d +*f ? .
What do you mean by Syntax Error
Does mentioning the array name gives the base address in all the contexts?
Differentiate between iterable and iterator.
What is a property class?
What is default array size?
If you are using c language to implement the heterogeneous linked list, what pointer type should be used?
What are data structures in programming?
Is it possible to store null key and null values in a hashmap?
Does treemap allow null key?
What do you mean by 2-3 tree?