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 are the disadvantages of sequential storage?
Which is best book for data structures?
What is meant by strongly connected in a graph?
Which sorting technique is best in worst case?
Does hashset allow duplicates?
How can we remove loops in a linked list? What are the functions of fast and slow pointers?
Does hashset guarantee order?
Write the disadvantages of separate chaining?
What do you mean by double hashing?
Which is better hashset or treeset?
What is the difference between hashset and hashtable?
What is the difference between arraylist and hashmap?
How to find if linked list has loop?
Design a datastructure to represent the movement of a knight on a chess board
Differentiate between an array and an arraylist.