Array sorting choosing tech

when to use which array sorting technique in array?

almost all the times we prefer using either mergesort or quicksort, as there time complexity is O(nlogn). But in the cases where you have some prior knowledge of input, you can use other sorting algorithms as well like,

  1. if the input is almost sorted and small in size, you can use bubble sort.
  2. for very small size input, insertion and selection sort are preferred.

Thanks

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.