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
Can arraylist store primitives?
What member function places a new node at the end of the linked list?
Explain extended binary tree.
Which interface treemap implements?
List the applications of queues?
Can constructor be static?
Is hashset a collection?
What is binary tree in computer science?
What are sorting algorithms used for?
How to find the duplicate in an array?
How can you represent a linked list node?
Differentiate between hashset and hashmap.
What is ds tree?
Is array size dynamic or fixed?
Explain the terms base case, recursive case, binding time, run-time stack and tail recursion.