Skip to content

Commit d5317cd

Browse files
Improve quick_select with type hints, edge case handling, and documentation
1 parent 871ca40 commit d5317cd

File tree

1 file changed

+0
-9
lines changed

1 file changed

+0
-9
lines changed

searches/quick_select.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -121,12 +121,3 @@ def median(items: List[int]) -> Optional[float]:
121121
return (low_mid + high_mid) / 2
122122

123123

124-
if __name__ == "__main__":
125-
assert quick_select([1, 2, 3], 1) == 2
126-
assert quick_select([], 0) is None
127-
assert quick_select([5, 4, 3, 2], 2) == 4
128-
assert quick_select([3, 5, 7, 10, 2, 12], 3) == 7
129-
assert median([3, 2, 2, 9, 9]) == 3
130-
assert median([2, 2, 9, 9, 9, 3]) == 6.0
131-
assert median([]) is None
132-
print("All assertions passed.")

0 commit comments

Comments
 (0)