A Common-Sense Guide to Data Structures and Algorithms, Second Edition — Pragmatic Programmers (207 / 226)
These are the solutions to the exercises found in the section, Exercises.
- Linear search on this array would take four steps. We start at the beginning of the array and check each element from left to right. Because the 8 is the fourth number, we’ll find it in four steps.
- Binary search would take just one step in this case. We start the…