Mental Model
Find the closest smaller or equal value (floor) and closest greater or equal value (ceil) to a target in a sorted list.
Analogy: Imagine standing on a number line with houses at certain addresses. Floor is the nearest house at or before your position, ceil is the nearest house at or after your position.
Array: [1] -> [3] -> [5] -> [7] -> [9] -> null Target: 6 Floor: 5 (nearest smaller or equal) Ceil: 7 (nearest greater or equal)
