I have a query regarding nested loop question here.

Why are we not multiplying the no of times outer loop is executing i.e. log(n) times

then answer should be: O(nlog(n))

# I have a query regarding nested loop question here. Why are we not multiplying th

see we are calculating the complexity already by considering the outer loop

like

n + n/2 + n/3…

here ‘n’ means for first time iteration of outer loop the inner loop executes ‘n’ times

n/2 means for second time iteration of outer loop the inner loop executes ‘n/2’ times

and so on.

and finally we are adding them all ( iterations of inner loop of all outer loop).

Then why we are not considering the outer loop? It should also be considered !!