new files
This commit is contained in:
parent
3af7344581
commit
86c034bb8b
1364 changed files with 21352 additions and 0 deletions
8
Task/Binary-search/Python/binary-search-3.py
Normal file
8
Task/Binary-search/Python/binary-search-3.py
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
index = bisect.bisect_left(list, item) # leftmost insertion point
|
||||
index = bisect.bisect_right(list, item) # rightmost insertion point
|
||||
index = bisect.bisect(list, item) # same as bisect_right
|
||||
|
||||
# same as above but actually insert the item into the list at the given place:
|
||||
bisect.insort_left(list, item)
|
||||
bisect.insort_right(list, item)
|
||||
bisect.insort(list, item)
|
||||
Loading…
Add table
Add a link
Reference in a new issue