A list is ordered from smaller to largest when a sort is
called. Which sort would take the shortest time to execute?
Answer Posted / ronak & sandip
In this case, both insertion and bubble sort will work exactly same as the time complexity of both method is O(n). But you have to mention one condition to check any swap has been made inside or not...if no swap has been made, it will come out of loop after executing it n times.
| Is This Answer Correct ? | 1 Yes | 1 No |
Post New Answer View All Answers
Which sorting is best?
What is fibonacci search?
Define linked lists?
What are linear and non linear data structures?
Define left-in threaded tree?
What is sorting in data structure?
Why hashmap is faster than hashset?
List the limitations of linear probing?
What is binary tree give example?
Does map extend iterable?
What is array sort?
Does the minimal spanning tree of a graph give the shortest distance between any 2 specified nodes?
What are the types of queues?
What is shell sort in data structure?
What is max heapify?