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