The printed split uses while naming the current length . For the intended stooge sort, read that split as at every recursive call. Keeping one fixed original instead is not the standard algorithm and does not generally sort correctly.
The three recursive calls then each have length , and all other work is constant. Thus
A version of the master theorem sufficient here states: if with constants , fixed-size base cases and for some , then , provided the recursive sizes shrink above the base threshold. Apply it with to obtain
The rounded size is important for correctness; it does not change this asymptotic exponent.

Articles by others on the same topic (0)

There are currently no matching articles.