projects
/
python_utils.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
444d1e5
)
Reformatting.
author
Scott
<
[email protected]
>
Wed, 26 Jan 2022 23:36:05 +0000
(15:36 -0800)
committer
Scott
<
[email protected]
>
Wed, 26 Jan 2022 23:36:05 +0000
(15:36 -0800)
list_utils.py
patch
|
blob
|
history
diff --git
a/list_utils.py
b/list_utils.py
index b877e381041d32564789232e1bb7329cc04503e6..b65ab0d69fab36196a94b4ef3327fae63b88f48d 100644
(file)
--- a/
list_utils.py
+++ b/
list_utils.py
@@
-229,7
+229,9
@@
def _permute(seq: Sequence[Any], path):
yield from _permute(cdr, path + car)
yield from _permute(cdr, path + car)
-def binary_search(lst: Sequence[Any], target: Any, *, sanity_check=False) -> Tuple[bool, int]:
+def binary_search(
+ lst: Sequence[Any], target: Any, *, sanity_check=False
+) -> Tuple[bool, int]:
"""Performs a binary search on lst (which must already be sorted).
Returns a Tuple composed of a bool which indicates whether the
target was found and an int which indicates the index closest to
"""Performs a binary search on lst (which must already be sorted).
Returns a Tuple composed of a bool which indicates whether the
target was found and an int which indicates the index closest to