summaryrefslogtreecommitdiff
path: root/list_utils.py
diff options
context:
space:
mode:
Diffstat (limited to 'list_utils.py')
-rw-r--r--list_utils.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/list_utils.py b/list_utils.py
index 992f1ae..88c436b 100644
--- a/list_utils.py
+++ b/list_utils.py
@@ -216,6 +216,7 @@ def permute(seq: Sequence[Any]):
"""
yield from _permute(seq, "")
+
def _permute(seq: Sequence[Any], path):
if len(seq) == 0:
yield path
@@ -228,7 +229,7 @@ def _permute(seq: Sequence[Any], path):
yield from _permute(cdr, path + car)
-def binary_search(lst: Sequence[Any], target:Any) -> Tuple[bool, int]:
+def binary_search(lst: Sequence[Any], target: Any) -> 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