Skip to content

Commit fc4977c

Browse files
Update quick_select.py
1 parent 1dc1b4d commit fc4977c

File tree

1 file changed

+2
-13
lines changed

1 file changed

+2
-13
lines changed

searches/quick_select.py

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -69,21 +69,10 @@ def median(items: list):
6969
It works efficiently on unsorted lists by partially sorting the data without
7070
fully sorting the entire list.
7171
72-
>>> import random
73-
>>> random.seed(0)
74-
75-
>>> d = [2, 2, 3, 9, 9]
76-
>>> random.shuffle(d)
77-
>>> d
78-
[3, 2, 2, 9, 9]
79-
>>> median(d)
72+
>>> median([3, 2, 2, 9, 9])
8073
3
8174
82-
>>> d = [2, 2, 3, 9, 9, 9]
83-
>>> random.shuffle(d)
84-
>>> d
85-
[2, 2, 3, 9, 9, 9]
86-
>>> median(d)
75+
>>> median([2, 2, 9, 9, 9, 3])
8776
6.0
8877
"""
8978
mid, rem = divmod(len(items), 2)

0 commit comments

Comments
 (0)