What is the time taken by Quicksort? -
if minimum time taken quicksort algorithm sort 1000 elements 100 seconds, minimum time taken sort 100 elements?
the correct answer don't know. o(n log n) behaviour describes highest order part of time dependency.
if assume implementation looking @ follows time = k * n * log n
(that is, assume there no lower order parts), answer be:
100 * 100 / 1000 * log 100 / log 1000 = 20/3 or approx 6.7 seconds
Comments
Post a Comment