Skip to content

Commit 7c76e2d

Browse files
authored
Fix undefined name: binary_search to make our test green!!
1 parent d67aff1 commit 7c76e2d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Binary_search.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# It returns location of x in given array arr
22
# if present, else returns -1
3-
def binarySearch(arr, l, r, x):
3+
def binary_search(arr, l, r, x):
44
if l <= r:
55

66
mid = (l+r) // 2 #extracting the middle element from the array
@@ -31,7 +31,7 @@ def binarySearch(arr, l, r, x):
3131
x = eval(input("Enter the element you want to search in given array"))
3232

3333
# Function call
34-
result = binarySearch(arr, 0, len(arr) - 1, x)
34+
result = binary_search(arr, 0, len(arr) - 1, x)
3535

3636
#printing the output
3737
if result != -1:

0 commit comments

Comments
 (0)