Quicksort (JAVA) -
lets have array of size n
randomly generated elements , want use quicksort sort array. large enough n (say 1,000,000), in order speed quicksort, make sense stop recursing when array gets small enough, , use insertion sort instead. in such implementation, base case quicksort value base > 1
. optimal base value choose , why?
think time complexity of quicksort (average , worst case) , time complexity of other sort might better small n.
Comments
Post a Comment