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 type of memory allocation is referred for Linked lists?
Why null is allowed in hashmap?
Why is arraylist faster than linkedlist?
What is a stable sorting algorithm?
What is Jagged Arrays?
Explain multiply linked list in short.
What is binary search tree and explain its time complexity?
Define union-by-weight?
How to increase stack limit in w3wp.exe?
List the data structures which are used in network data modal.
Explain what are the major data structures used in the network data model?
What are the types of queues?
What the principle of quick sort and its complexity?
Why is null not allowed in concurrenthashmap?
Is arraylist faster than array?