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


Please Help Members By Posting Answers For Below Questions

What are the advantages of binary search over linear search?

832


What are the Advantages and disadvantages of Array?

779


What is a stable sorting algorithm?

765


Why would you use a linked list?

671


Which language is best for data structures?

723


What is adt and its advantages?

722


What are the disadvantages of using collection classes over arrays?

696


What is the purpose of thread?

680


What is sequential search? What is the average number of comparisons in a sequential search?

625


Define secondary clustering?

670


What is structure of data type?

673


What is m way tree in data structure?

799


What is data and data structure?

689


What are the types of data structures?

777


What is numeric array?

591