1
Yes, and there are different ways to do it! You could start at page 1 and look at every name—that's a Linear Search. It's slow if you're looking for 'Zainab'.
Or you could open the book in the middle. If 'Zainab' is after that page, you throw away the first half and repeat. That's a Binary Search. It's much faster!
In coding, we are always looking for the 'faster' way to get the job done. Think about how you find things in a busy market like Balogun—you already use these tricks!
Log in to add a comment.