Binary search time complexity, partition time complexity

 Binary search time complexity

partition time complexity

O (n) = O (n) + O (n / 2) + O (n / 4) + ....

Then geometric summation formula obtained is O (2n), i.e., O (n)

 

Guess you like

Origin www.cnblogs.com/ymjyqsx/p/11323383.html