edited by
581 views
1 votes
1 votes
What is the time complexity to divide an array of elements N into $Log N$  parts ? plz explain ?
edited by

2 Answers

0 votes
0 votes
The answer would be nloglogn

As we have seen when array of size N is divided into k arrays having size n then time complexity becomes O(nklogk)

Now we can replace values according to our given question which will results to O(NloglogN)
0 votes
0 votes

Each division will take O(1) time. In first stage there is only 1 division, next stage there are 2 divisions, then 4 then 8 and so on. In last stage we need loglogN divisions.

We can write each division size of last stage N/logN = N/(2loglogN).

So we get series like 1+21+22+23+24+....+loglogN ( loglogN = 2logloglogN ) . Now by solving the G.P series we get O(loglogN).

Related questions

0 votes
0 votes
2 answers
2
_Madhuri asked Oct 9, 2021
664 views
The complexity of comparison based sorting algorithm is (nlogn) .How?
0 votes
0 votes
0 answers
3
1 votes
1 votes
2 answers
4
Ravi Dubey asked Aug 2, 2018
855 views
Could a binary search tree be built using o(n lg n) comparisons in the comparisonmodel? Explain why or why not.