To complete before meeting
- Confirm you have access to our CS106M Ed forum.
- Read Week 2 post on Ed forum that gives background info on binary search
- ✅ Write your own implementation of binary search with test cases to verify it works correctly.
- ✅ Have your completed code and test cases ready on Ed for show and tell at meeting.
Further resources
If after finishing the code, you have some extra time and unsated curiosity, here is some additional reading to peruse. The two book chapters can be accessed from the Stanford Library digital collection (click the link below, authenticate with your Stanford sunet, and find link to full book in section labeled "Available online").
- Jon Bentley, "Writing Correct Programs", Column 4 of Programming Pearls
- Tim Bray, On the Goodness of Binary Search
- Albert Savoia, "Beautiful Tests", Chapter 7 of Beautiful Code
- Josh Block, Nearly All Binary Searches are Broken
- How does a "pro" write it? Check out these versions from standard libraries