Skip to content

Commit 8996079

Browse files
committed
add test
1 parent d09c2f1 commit 8996079

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

docs/13_高级排序算法/quicksort.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,10 @@ def test_nth_element():
9898
array = [3, 2, 1, 5, 6, 4]
9999
assert nth_element(array, 0, len(array), 2) == 2
100100

101+
array = [2,1]
102+
assert nth_element(array, 0, len(array), 1) == 1
103+
assert nth_element(array, 0, len(array), 2) == 2
104+
101105

102106
if __name__ == '__main__':
103107
test_nth_element()

0 commit comments

Comments
 (0)