Given a sorted array, the binary search algorithm is much more efficient than just iterating through the entire array. You're narrowing the number of elements you need to look at after each check by half. In this activity, you're going to be using the binary search algorithm to traverse a sorted array of strings in order to find a target word.
-
You are given a target word as the first argument and an array of strings in the second argument.
- The second array is sorted alphabetically
-
Find the target word within the array of strings using binary search.