The data may not be an array.
transcript
Find the integer square root of n. There is no list to search. But there is a flag. The flag still works. Here is how.
The numbers from zero to n are the data. The flag is: i times i is above n. The root is the first true minus one. Say it aloud first.
The squares of zero to five. The first square above seventeen is twenty-five. That is position five. The root is four. Four squared is sixteen, which is not above seventeen. Five squared is twenty-five, which is.
Now take n near two billion. Forty-six thousand squared overflows 32 bits. Use 64 bits for the product. The flag would then read false when it should read true.
Other data is sorted too. A running total is sorted if spend never falls. Double a probe to find a file's end. Then search below it as usual.
Write the flag. Use 64 bits for products. Check one past the end. Full breakdown in the lecture.