From eddac153a064648bee2aef6fb733ab6820bb96c3 Mon Sep 17 00:00:00 2001 From: Shinya Sato Date: Thu, 28 Apr 2022 21:41:58 +0900 Subject: v0.8.2 --- comparison/Python/qsort-800000.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'comparison/Python/qsort-800000.py') diff --git a/comparison/Python/qsort-800000.py b/comparison/Python/qsort-800000.py index b58bf1c..a4a66e2 100644 --- a/comparison/Python/qsort-800000.py +++ b/comparison/Python/qsort-800000.py @@ -22,12 +22,22 @@ def quickSort(arr): more = quickSort(more) return less + pivotList + more + def mkRandList ( n ): a=[] for i in range(1,n+1): a.insert(0, random.randint(0,10000)) return a + +def validation(alist): + for i in range(len(alist)-1): + if (alist[i] > alist[i+1]): + return False + + return True + + a = mkRandList(800000) b = quickSort(a) -#print(b) +print(validation(b)) -- cgit v1.2.3