Binary search: Difference between revisions
Content deleted Content added
Line 1,823: | Line 1,823: | ||
'''Recursive''' |
'''Recursive''' |
||
{{incorrect|raises an error if given empty list}} |
{{incorrect|Python|It raises an error if given empty list.}} |
||
<lang python>def binary_search(l, value, low = 0, high = -1): |
<lang python>def binary_search(l, value, low = 0, high = -1): |
||
if(high == -1): high = len(l)-1 |
if(high == -1): high = len(l)-1 |