Ask Question

Why is insertion sort faster than quicksort for small arrays?

+2
Answers (1)
  1. 31 May, 08:38
    0
    It's not guaranteed to be faster on small arrays, but it can be. The organization of the data is probably more important than the size. If look at the complexity's of the two algorithms you can find your answer. Quicksort worst case is O (n^2) but its average is O (nlogn). Insertion sort is average and worst case is both O (n^2). So the best conclusion would be if the data was arrange so the quicksort pivot selection is at it's worst, then I guess insertion could be faster.
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “Why is insertion sort faster than quicksort for small arrays? ...” in 📗 Computers & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers