In this lesson, you'll learn how the binary search algorithm works to find information efficiently and elegantly.
There are two components to this lesson:
Note: The myGA module contains a link to an exercise in CodePen. The code in CodePen is the exact same as the code for the in-class exercises. Try out the exercise in CodePen and see how far you can get with it. Leave off where you get stuck and we'll review the solution in class.
By the end of this lesson, you will be able to:
- Understand the Big O complexities of brute force and binary search approaches.
- Describe how binary search works.
- Write a binary search algorithm to find a value in an array.
- Big O Notation
- Recursion
- Intro to Sorting Algorithms
1.5 hours total:
- 0.5 hour myGA
- 1 hour in class
- Check out this article that outlines common interview questions related to binary search.
- More thoughts on how binary search appears in job interviews.
- Algorithmic folk dancers, this time with search!