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
How do you sort an arraylist in descending order?
Define union-by-weight?
Are linked lists considered linear or non-linear data structures?
What is sorting an array?
What is list data structure?
What do you mean by disjoint set adt?
Differentiate between iterator and listiterator.
What is impact of signed numbers on the memory using data structures?
Is quicksort greedy algorithm?
How many times is merge sort called?
What is the difference between a hashmap and hashtable?
What is definition list?
Define primary data structures?
Is arraylist a collection?
Check if duplicates exist in an array of N which has range 1 to N.