• edited by
1,161 views
1 1 vote
What is the time complexity to divide an array of elements N into $Log N$  parts ? plz explain ?

2 Answers

0 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 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).

Position:
Show:

Related questions

1 1 vote
1 1 answer
128
128 views
GO Classes asked Aug 25
128 views
Let $P$ be the problem of sorting $n\geq1$ elements using only comparisons.Consider the class of all comparison-based algorithms that correctly solve $P$.What is the asym...
0 0 votes
1 answers 1 answer
898
898 views
Mrityudoot asked Mar 7, 2024
898 views
For flag based approach in Bubble sort we can check first by a flag if the list is sorted or not in O(n), and if it is sorted, then no need to sort and the operation ends...
0 0 votes
2 answers 2 answers
1.3k
1.3k views
_Madhuri asked Oct 9, 2021
1,292 views
The complexity of comparison based sorting algorithm is (nlogn) .How?
0 0 votes
0 0 answers
458
458 views