algorithm - Big O(n logn) is not preferable over the O(n^2) -


any algorithms example when prefer big o(n^2) time complexity on o(n logn)? have seen question somewhere did not find answer.

for large problem, o(n log n) beat o(n^2). small problem, constant factors hidden big-o notation may cause prefer o(n^2) algorithm. instance, o(n log n) quicksort faster o(n^2) insert sort, quicksort implementations switch insert sort when partitions small (less ten elements).


Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -