retagged by
449 views
1 votes
1 votes
suppose merge sort takes 2 sec to sort a set of 64 keys then how much time will take to sort a set of 512 keys?

here, ans is 24 sec how it is plz explain me.
retagged by

1 Answer

2 votes
2 votes

for merge sort time complexity =>

nlog2(n) = t

64 log(64) =2  ==>  26 * 6 = 2                             .... 1

than 512 log (512) ==> 29 * 9 = t                        .... 2

dividing 1 by 2.....

t = 23*3 

which is equal to 24ans.

 

 

Related questions

0 votes
0 votes
1 answer
2
0 votes
0 votes
0 answers
3
Emankashyap asked 6 days ago
57 views
In quick sort, n numbers the (n/10)th element is selected as pivot using n^2 sortimng time complexity what will be the time complexity of quick sort is.....a)O(nlogn)b)O(...