From fa9171c4c8cc79cde1facf65644728f5ba5a8917 Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Sun, 26 Jun 2016 03:01:04 +0300 Subject: quicksort: seed RNG --- algorithms/impl/quicksort.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/algorithms/impl/quicksort.py b/algorithms/impl/quicksort.py index ddc8269..9230187 100644 --- a/algorithms/impl/quicksort.py +++ b/algorithms/impl/quicksort.py @@ -2,11 +2,13 @@ # This file is licensed under the terms of the MIT License. # See LICENSE.txt for details. -from random import randrange +from random import randrange, seed import sys from ..algorithm import SortingAlgorithm +seed() + def _partition(xs, beg, end, select_pivot): pivot = select_pivot(xs, beg, end) xs[pivot], xs[end] = xs[end], xs[pivot] -- cgit v1.2.3