ISRO Computer Science (CSE) 2015 - Question 12

All ISRO Computer Science (CSE) papers | ISRO Computer Science (CSE) 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

Answer: B. 6.7 sec

Explanation: Time T(n) = C * n * log(n). 100 = C * 1000 * log(1000). T(100) = C * 100 * log(100). Ratio T(100)/100 = (100 * 2) / (1000 * 3) = 1/15. T(100) = 100/15 = 6.66 sec.

| | All questions of ISRO Computer Science (CSE) 2015