Skip to content
Related Articles

Related Articles

ISRO | ISRO CS 2015 | Question 12

View Discussion
Improve Article
Save Article
  • Last Updated : 03 Apr, 2018
View Discussion
Improve Article
Save Article

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)

Explanation: Best case time complexity of quick sort to take the minimum time to sort names = O(n log n)

let t1 = time taken to sort 1000 names = 100 sec;
n1=1000 names
let t2 = time taken to sort 100 names;
n2= 100 names

t1/t2 = n1*log(n1) / n2*log(n2) 
100/t2 = 1000*log(1000) / 100*log(100)
100/t2 = 10*log(1000) / log(100)
100/t2 = 10*3 / 2
t2 = 20/3 = 6.66 

Option (B) is correct

Quiz of this Question

My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!