摘要: 1.bisect:使用二分法,在一个已排序的序列查找合适的插入位置。>>>import bisect>>>l = [10,19,88,90]>>>bisect.bisect(l, 22)>>>2 #适合插入的位置为2bisect.bisect_left(l, 22) #如果已经在列表中存在,返... 阅读全文
posted @ 2015-02-12 14:02 huangxiaohen 阅读(609) 评论(0) 推荐(0) 编辑