We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 75d35e4 commit 05f854fCopy full SHA for 05f854f
Binary_search.py
@@ -3,7 +3,8 @@
3
def binarySearch(arr, l, r, x):
4
while l <= r:
5
6
- mid = l + (r - l) / 2; #extracting the middle element from the array
+ mid = l + (r - l) / 2 #extracting the middle element from the array
7
+ mid=int(mid) #it has to be integer
8
9
# Check if x is present at mid
10
if arr[mid] == x:
0 commit comments