mirror of
https://github.com/onyx-and-iris/grokking-algorithms.git
synced 2024-11-16 01:40:53 +00:00
8 lines
152 B
Python
8 lines
152 B
Python
|
import math
|
||
|
|
||
|
num_steps = int(math.log2(128))
|
||
|
print(
|
||
|
f"A binary search would take maximum {num_steps} steps "
|
||
|
"to search a list of 128 items."
|
||
|
)
|