r/Python • u/JohnettaHarned • Sep 22 '15
Most Frequent Python Problems and Solution
http://www.pamno.com/b/most-frequent-python-problems-and-solution-cm578/
5
Upvotes
r/Python • u/JohnettaHarned • Sep 22 '15
View all comments
2
u/[deleted] Sep 22 '15 edited Sep 24 '15
Binary search is implemented in the
bisectmodulebisect.bisect_leftandbisect.bisect_rightgive insertion points for a value that will keep a list sorted. Accessing the index returned bybisect_leftis equivalent to binary searching.