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

Popular posts from this blog

python - pip install -U PySide error -

arrays - C++ error: a brace-enclosed initializer is not allowed here before ‘{’ token -

cytoscape.js - How to add nodes to Dagre layout with Cytoscape -