Skip to content

Commit

Permalink
Shortened code (TheAlgorithms#3855)
Browse files Browse the repository at this point in the history
  • Loading branch information
jbaenaxd authored Nov 1, 2020
1 parent a538989 commit 1f65007
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions searches/quick_select.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,7 @@ def quick_select(items: list, index: int):
if index >= len(items) or index < 0:
return None

pivot = random.randint(0, len(items) - 1)
pivot = items[pivot]
pivot = items[random.randint(0, len(items) - 1)]
count = 0
smaller, equal, larger = _partition(items, pivot)
count = len(equal)
Expand Down

0 comments on commit 1f65007

Please sign in to comment.