A machine needs a minimum of 100 sec to sort 1000 names by quick sort. The…
2015
A machine needs a minimum of 100 sec to sort 1000 names by quick sort. The minimum time needed to sort 100 names will be approximately
- A.
50.2 sec
- B.
6.7 sec
- C.
72.7 sec
- D.
11.2 sec
Attempted by 217 students.
Show answer & explanation
Correct answer: B
Quick Sort complexity is O(n log n). Using proportionality: T(100)/T(1000) = (100 log 100)/(1000 log 1000). Simplifying logs: (100 * 2)/(1000 * 3) = 1/15. Thus T(100) ≈ 100 * (1/15) ≈ 6.7 seconds.