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
Write the algorithm for converting infix expression to postfix expression?
What is difference between list and linked list?
Why is waste sorting important?
What is quick sort?
How many parts are there in a declaration statement?
There are 2 int type array data type. One is containing 50 elements, and another one is containing 30 elements. Can we assign the array of 50 elements to an array of 30 elements?
Describe tree database. Explain its common uses.
What is difference between tree and forest?
What is a spanning tree in data structure?
What are the types of algorithms?
Is it possible to make an array volatile in java?
How do you perform a merge sort?
Where will be the free node available while inserting a new node in a linked list?
What is heap tree in data structure?
What is the difference between binary tree and binary search tree?