DATA STRUCTURE
Programming and Technical
Programming
Technical
A list is ordered from smaller to largest when a sort is
called. Which sort would take the shortest time to
execute?
Read Solution (Total 4)
-
- since the list is already sorted then
1) if the list size is small then insertion sort take O(n) time which is best.
2) if the list size is large then merge sort take O(nlogn) time which is best.
note for small size array or list insertion sort is best and for large size merge sort in best . - 10 years agoHelpfull: Yes(7) No(0)
- this will depend upon the number of sorting element if element is much larger then better to go merge sort and if no. of sorting element are not much larger then better to go through quick sort.
- 11 years agoHelpfull: Yes(2) No(2)
- selection sorting
- 10 years agoHelpfull: Yes(0) No(3)
- quick short
- 10 years agoHelpfull: Yes(0) No(3)
DATA STRUCTURE Other Question