Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> you have to also check that the index is in the list (instead of off the end) and that the value at the resulting index equals the value of interest to test containment

True. However, the hardest part of the binary search algorithm is implemented through bisect, so it still saves a lot of developer time.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: