A list is ordered from smaller to largest when a sort is
called. Which sort would take the shortest time to execute?
Answer Posted / sathyanarayana
Yes, its insertion sort. For a sorted array, it takes just
O(n) time. iTs mere traversal of an array as it is already
sorted. In the case of quick sort, it boils down to O(n^2)
in the case of sorted array.
| Is This Answer Correct ? | 5 Yes | 3 No |
Post New Answer View All Answers
Why are b trees used?
What do you mean by balance factor of a node in avl tree?
Does list allow null values?
What is heap tree in data structure?
Explain what are the methods available in storing sequential files ?
Why is quicksort unstable?
What is fibonacci search?
Which is the parent class of hashmap class?
How can you correct these errors?
Write a Program for Insert in a sorted list
What are linear and non linear data structures?
How can we remove loops in a linked list? What are the functions of fast and slow pointers?
What are the five examples of data?
Why do we use linked lists?
What is arrays copyof?