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
What is difference between static and dynamic array?
What is a hashmap in c?
Which language is best to learn data structures?
What is a stable sorting algorithm?
What is the difference between binary tree and binary search tree?
Why do we need algorithm?
How do I sort a hashmap key?
What do you mean by hash table?
Why is reflection slower?
What is push and pop in stack?
What is an example of an algorithm?
How does hashset maintain order?
Why we use linked list?
Is vector a collection?
Is a hashmap a dictionary?