Exercise 1: Tracing Binary Search for Target 23 — Possible Solution ==================================================================== GIVEN ------------------------------ arr = [3, 7, 11, 15, 19, 23, 27, 31] (indices 0-7) target = 23 STEP-BY-STEP TRACE ------------------------------ Step 1: lo=0, hi=7, mid=(0+7)//2=3, arr[3]=15 15 < 23, so search the right half: lo becomes 4 Step 2: lo=4, hi=7, mid=(4+7)//2=5, arr[5]=23 arr[5] equals the target - found! TOTAL COMPARISONS ------------------------------ 2 comparisons were needed to find the target among 8 elements - consistent with this chapter's own Theta(log n) bound: log2(8) = 3, and 2 comparisons is within that bound (the exact count depends on where the target happens to fall, per Chapter 4's own best/worst-case distinction). WHY THIS WORKS AS AN ANSWER ------------------------------ Each step is traced following exactly this chapter's own trace format - showing lo, hi, mid, and the value found at mid before making the next decision - and the final comparison count is checked against the chapter's own Theta(log n) bound for an array of this size, rather than left unverified.