mirror of
https://github.com/autistic-symposium/master-algorithms-py.git
synced 2025-04-29 20:26:07 -04:00
Update binary_search.py
This commit is contained in:
parent
e4bfc72334
commit
cd0575f81e
@ -2,6 +2,7 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# author: bt3gl
|
||||
|
||||
|
||||
def binary_search_recursive(array, item, higher=None, lower=0):
|
||||
|
||||
higher = higher or len(array)
|
||||
@ -30,6 +31,7 @@ def binary_search_iterative(array, item):
|
||||
lower=mid+1
|
||||
return False
|
||||
|
||||
|
||||
def binary_search_matrix(matrix, item, lower=0, higher=None):
|
||||
""" Binary search in a matrix """
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user