Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/geekcomputers/Python
/ Binary_search.py
File
Binary_search.py
Binary_search.py:None–None ·
view source on GitHub ↗
Source
from the content-addressed store, hash-verified
1
# It returns location of x in given array arr
2
# if present, else returns -1
3
def
binary_search(arr, l, r, x):
4
# Base case: if left index is greater than right index, element is not present
Callers
nothing calls this directly
Calls
1
binary_search
Function · 0.85
Tested by
no test coverage detected