edited by
10,566 views

2 Answers

Best answer
22 votes
22 votes
Running time of quick sort = c n lg n

For n = 1000, we get

100 = c * 1000 * lg 1000 => c = 0.01

So, for n = 100, we get running time = 0.01 * 100 * lg 100 = 6.7
selected by
13 votes
13 votes
min no of comparison for quick sort = nlogn

so to sort 1000 names 1000*3 ie 3000 comparisons are needed.

For 3000 comparisons we need 100s , thus for 1 comparison we need 0.033s

To sort 100 names we need 200 comparisons thus time needed is 0.033*200 s = 6.67 s
Answer:

Related questions

7 votes
7 votes
5 answers
1
shivanisrivarshini asked Jun 5, 2016
6,835 views
The number of spanning trees for a complete graph with seven vertices is$2^5$$7^5$$3^5$$2^{2 \times 5}$
53 votes
53 votes
4 answers
2
48 votes
48 votes
2 answers
3
Kathleen asked Sep 23, 2014
22,542 views
If one uses straight two-way merge sort algorithm to sort the following elements in ascending order: $20, \ 47, \ 15, \ 8, \ 9, \ 4, \ 40, \ 30, \ 12, \ 17$then the o...
31 votes
31 votes
6 answers
4
Kathleen asked Sep 18, 2014
19,267 views
The time complexity of the following C function is (assume $n 0$)int recursive (int n) { if(n == 1) return (1); else return (recursive (n-1) + recursive (n-1)); }$O(n)$$...