A list is ordered from smaller to largest when a sort is
called. Which sort would take the shortest time to execute?
Answer Posted / soumitra biswas
modified bubble sort with flag.As the array is already sorted
there will be no swapping in first pass,so no comparison
will take place after first pass and program stops executing.
time complexity =0(n).
Is This Answer Correct ? | 1 Yes | 1 No |
Post New Answer View All Answers
Can a hashset contain duplicates?
What are the disadvantages of circular list?
Is stack a dynamic data structure?
in tree construction which is the suitable efficient data structure? (Array, linked list, stack, queue)
Why is quicksort not stable?
Which sorting is best for large data?
Which sort is best for linked list?
How do you use the sort function?
What is advantage and disadvantage of linked list?
State the demerit of linear representation of binary trees?
What is list and types of list?
Can we use ordered set for performing binary search?
What is default array size?
What is difference between hashmap and hashtable?
What are different types of linked lists?