new tasks
This commit is contained in:
parent
2a4d27cea0
commit
80737d5a6a
1194 changed files with 15353 additions and 1 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