retagged by
983 views
1 votes
1 votes
Q.  The best case of quick sort helps Aditya to sort a particular data set of size ‘n’ in 640 ms. Suresh also tried the same algorithm on similar data set and it took him 256 ms in best case to sort a file of size 16. What could be Aditya’s file size?
retagged by

1 Answer

4 votes
4 votes
When we say best case is n log n = nklogn where k it's constant

So 16 k log 16 = 256

So k will be 4

Thus n*4logn= 640

n log n = 160

N= 32

Related questions

2 votes
2 votes
1 answer
1
2 votes
2 votes
0 answers
2
kallu singh asked Dec 16, 2017
307 views
0 votes
0 votes
1 answer
3
kallu singh asked Aug 19, 2017
233 views
What is the time complexity to construct a binary tree when inorder and preorder traversal of the tree is given?1. O(n)2.O(n log n)3. O(n2)4.O(n2 log n)