February 2006
Intermediate to advanced
648 pages
14h 53m
English
The bisect module provides support for keeping lists in sorted order. It uses a bisection algorithm to do most of its work.
bisect(list, item [, low [, high]])
Returns the index of the insertion point for item to be placed in list in order to maintain list in sorted order. low and high are indices specifying a subset of the list to examine. If items is already in the list, the insertion point will always be to the right of existing entries in the list.
bisect_left(list, item [, low [, high]])
Returns the index of the insertion point for item to be placed in list in order to maintain list in sorted order. low and high are indices specifying a subset of the list to examine. If items is already in the list, the insertion point will always ...