Easy · O(log n)
Binary Search quiz
Pick an answer to see whether it's right, and why. Nothing is saved or sent.
Question 1 of 10
- Question 1: current
- Question 2: not answered yet
- Question 3: not answered yet
- Question 4: not answered yet
- Question 5: not answered yet
- Question 6: not answered yet
- Question 7: not answered yet
- Question 8: not answered yet
- Question 9: not answered yet
- Question 10: not answered yet
binarySearch looks for 23 in [2, 5, 8, 12, 16, 23, 38, 56, 72, 91]. Which indexes does the loop look at, in order?
Take it further
- AnimationSearching
Binary Search Animation
A step-by-step binary search with gliding lo / mid / hi pointers, ready for your lessons, slides and posts
Free
