Skip to content
Related Articles

Related Articles

ISRO | ISRO CS 2015 | Question 12
  • Last Updated : 03 Apr, 2018

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

Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.

My Personal Notes arrow_drop_up
Recommended Articles
Page :