Skip to content

fix type error (except an int) in jumpmp_search line 7. #283

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

Merged
merged 1 commit into from
Apr 13, 2018

Conversation

clobob
Copy link
Contributor

@clobob clobob commented Apr 13, 2018

Try to run this on Python 2.7.10.
An error occurs, the error log like this:
Traceback (most recent call last):
File "jump_search.py", line 25, in
index = jump_search(arr, x)
File "jump_search.py", line 7, in jump_search
while arr[min(step, n)-1] < x:
TypeError: list indices must be integers, not float

the fix make the code can be run under python2 & python3.

@christianbender christianbender merged commit 0a1b6ad into TheAlgorithms:master Apr 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants