Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions searches/binary_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@
"""
Pure Python implementations of binary search algorithms

Basic Idea:
Binary Search works by repeatedly dividing the search interval in half.
If the target value is smaller than the middle element, the search continues
in the left half. Otherwise, it continues in the right half.
This process repeats until the element is found or the interval becomes empty.

For doctests run the following command:
python3 -m doctest -v binary_search.py

Expand Down
Loading