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
How does shell sort work?
What are three common types of traversals?
Can arraylist be empty?
Define dynamic data structures?
What is linked list ?
what are the applications of Linked Lists?
Are collections thread safe?
Explain the most efficient method to reverse a linked list?
What is an expression tree?
Does arraylist extend list?
Does map extend iterable?
where do you use double linked list?
Can value be null in treemap?
Explain what is the bucket size, when the overlapping and collision occur at same time?
What is collections singletonmap?