retagged by
433 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
1 answer
4
Shailendra Patel asked Nov 1, 2016
381 views
Merging K sorted list each of size n/k into one sorted list of n-elements using Heap Sort will take how much time?