A list is ordered from smaller to largest when a sort is
called. Which sort would take the shortest time to execute?
Answer Posted / rohit
Bubble sort with a flag variable to check if comparisons
occur or not. If it is already sorted then in just 1
iteration it will show that the array is sorted which is
not possible in any other sort.THUS JUST 1 ITERATIION IS
REQUIRED IN THIS CASE.
| Is This Answer Correct ? | 27 Yes | 2 No |
Post New Answer View All Answers
How would you use qsort() function to sort the name stored in an array of pointers to string?
What is the space complexity of bubble sort?
Is boolean a data type?
What is the difference between arraylist and hashmap?
What is a subtree in data structures?
What is a vector class?
Which is faster array or arraylist?
How long does it take to master data structures and algorithms?
What is difference between array and arraylist? When will you use array over arraylist?
What do you mean by articulation point?
What are types of Collision Resolution Techniques and the methods used in each of the types?
Define outdegree of a graph?
What the principle of quick sort and its complexity?
What member function places a new node at the end of the linked list?
Provide an algorithm to reverse a linked list without using recursion.