Skip to content

Fixing lgtm warning in interpolation search per #1024 #1140

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
4 changes: 2 additions & 2 deletions searches/interpolation_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,14 +120,14 @@ def __assert_sorted(collection):
target = int(target_input)
"""

debug = 0
debug = 1
if debug == 1:
collection = [10,30,40,45,50,66,77,93]
try:
__assert_sorted(collection)
except ValueError:
sys.exit('Sequence must be ascending sorted to apply interpolation search')
target = 67
target = 66

result = interpolation_search(collection, target)
if result is not None:
Expand Down