bisect.insort

bisect.insort(a, x[, lo[, hi]])

insort_right(a, x[, lo[, hi]])

Insert item x in list a, and keep it sorted assuming a is sorted.

If x is already in a, insert it to the right of the rightmost x.

Optional args lo (default 0) and hi (default len(a)) bound the slice of a to be searched.

Navigation