Skip to content

Commit 07d46a1

Browse files
author
Amogh Singhal
authored
Update binary_search_recursive.py
1 parent af01689 commit 07d46a1

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

binary_search_recursive.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# Given an array , find if the number exists
2+
# This is a `recursive` implementation of the
3+
# binary search. If the element is not found
4+
# it returns -1
5+
16
def binarySearch(lst, key, l, r):
27
if r>=l:
38
mid = l + (r-l) // 2

0 commit comments

Comments
 (0)