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 is the procedure to insert into a sorted array?

562


How many types of data structures are used?

522


If we try to add duplicate key to the hashmap, what will happen?

487


What is an array vs list?

484


What is hashing in cyber security?

510






How many types of data structure are there?

458


How do you declare An array of three char pointers

516


What is collision in data structure?

506


Define non linear data structure.

586


What is linear-logarithm chasm?

546


How can someone display singly linked list from first to last?

509


What do u mean by array?

481


What is stack in data structure with the example?

435


What is difference between hashmap and treemap?

496


What is linear and non linear structure?

495