I have seen in books that when number of elements is small ~ 30-40 insertion sort is recommended. Why is that? The worst case of insertion sort is n(adsbygoogle = window.adsbygoogle || []).push({}); ^{2}whereas for quick-sort it is nlogn.

nlogn beats n^{2}for all values of n isn't it? Then why?

**Physics Forums | Science Articles, Homework Help, Discussion**

Join Physics Forums Today!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Why insertion sort works better than quick-sort for small data?

**Physics Forums | Science Articles, Homework Help, Discussion**