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
What is the difference between array and stack?
Why is it called bubble sort?
What happens if an array goes out-of-bounds?
Define biconnectivity?
Differentiate between iterator and enumeration.
Are sets sorted?
What are the types of binary tree?
Explain extended binary tree.
What should I learn first data structures or algorithms?
How can you implement a stack?
What is a threaded binary tree? Explain its operation with example?
What is difference between data type and data structure?
What is array simple?
Define primary clustering?
What is long data type?