Skip to content
Merged
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
4 changes: 2 additions & 2 deletions Binary_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ def binarySearch(arr, l, r, x):
# If element is smaller than mid, then it can only
# be present in left subarray
elif arr[mid] > x:
return binary_search(arr, l, mid - 1, x)
return binarySearch(arr, l, mid - 1, x)

# Else the element can only be present in right subarray
else:
return binary_search(arr, mid + 1, r, x)
return binarySearch(arr, mid + 1, r, x)

# If we reach here, then the element was not present
return -1
Expand Down