Why do two versions of bisection search land on different Thetas, and when is sorting a list first worth the cost?
Short drills on what this video just taught. Write the code, run the checks, and reveal the answer only if you are stuck.
Bisection keeps halving the part it searches until one element is left. Define halvings(n) that starts from n elements (n >= 1), repeatedly keeps half of them with integer division by 2, and returns how many halvings it takes to reach exactly 1 element. A while loop and // are all you need.