The value at a time: upper bound, minus one.
transcript
What was the value at time seventeen? Search the changes by time. Then step back one.
A setting changed five times. The times are sorted. Ask for time seventeen.
The middle change is at time eighteen. That is after seventeen. So the first later change is at eighteen, or before. We keep the left half and look again.
The next middle is time ten. That is at most seventeen. So move past it.
First change after the time: eighteen. The answer is the one before it. That change has time ten. Sorted changes make this a binary search, and it takes few steps.
Compare with at most, not less than. A change at the time counts. With no change before, return minus one.
A lookup is one binary search. It takes about seventeen steps. A scan would take a hundred thousand.
Find the first change after. Step back one. Full breakdown in the lecture.