标签:import div port col code ISE color 二分查找 sort
1 #!/user/bin/env python 2 # -*- coding:utf-8 -*- 3 4 # 用来处理已排序的序列,用来维持已排序的序列,升序 5 # 二分查找 6 import bisect 7 8 9 inter_list = [] 10 bisect.insort(inter_list, 3) 11 bisect.insort(inter_list, 1) 12 bisect.insort(inter_list, 4) 13 bisect.insort(inter_list, 5) 14 bisect.insort(inter_list, 6) 15 bisect.insort(inter_list, 2) 16 17 print(bisect.bisect(inter_list, 3)) 18 print(bisect.bisect_left(inter_list, 3)) 19 print(bisect.bisect_right(inter_list, 3)) 20 print(inter_list)
标签:import div port col code ISE color 二分查找 sort
原文地址:https://www.cnblogs.com/zydeboke/p/11247845.html