edited by
10,915 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.0k
views
5 answers
7 votes
shivanisrivarshini asked Jun 5, 2016
7,027 views
The number of spanning trees for a complete graph with seven vertices is$2^5$7^5$3^5$2^{2 \times 5}$
18.2k
views
4 answers
53 votes
Anu asked Jun 1, 2015
18,246 views
A hash table with ten buckets with one slot per bucket is shown in the following figure. The symbols $S1$ to $S7$ initially entered using a hashing function with ... $5$6$3$
23.2k
views
2 answers
48 votes
Kathleen asked Sep 23, 2014
23,187 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 order of ... $4, \ 8, \ 9, \ 15, \ 20, \ 47, \ 12, \ 17, \ 30, \ 40$
19.8k
views
6 answers
31 votes
Kathleen asked Sep 18, 2014
19,752 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)$O(n \log n)$O(n^2)$O(2^n)$