Книга: A Common-Sense Guide to Data Structures and Algorithms in Python, Volume 1
Назад: Wrapping Up
Дальше: Chapter 3: O Yes! Big O Notation

Exercises

The following exercises provide you with the opportunity to practice with binary search. The solutions to these exercises are found in the section .

  1. How many steps would it take to perform a linear search for the number 8 in the ordered array [2, 4, 6, 8, 10, 12, 13]?

  2. How many steps would binary search take for the previous example?

  3. What is the maximum number of steps it would take to perform a binary search on an array of size 100,000?

Назад: Wrapping Up
Дальше: Chapter 3: O Yes! Big O Notation