Skip to content
Open
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
17 changes: 16 additions & 1 deletion projects/bsearch/BlackExcellencebsearch.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Bsearch

#Jacari Boboye
#Malik HornBuckle
#Maalik Hornbuckle
#Isaiah Williams
#Justin Austin
#David Blackstone
Expand Down Expand Up @@ -86,4 +86,19 @@ def bsearch(List, searchFor):

else:
return mid

#Maalik Hornbuckle
def bsearch(myList, value):
low = 0; high = len(myList) - 1
while 1:
if high < low:
return -1
mid = (low + high) / 2
if myList[mid] < value:
low = mid + 1
elif myList[mid] > value:
high = mid - 1
else:
return mid
myList.sort()