From 106155202d239efebb7dc88871c5c64b8c00d9de Mon Sep 17 00:00:00 2001 From: "Richard Horton (hortonr6)" Date: Mon, 22 Jul 2019 11:56:28 +0100 Subject: [PATCH] Added Comments --- Sorting.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Sorting.py b/Sorting.py index b3295d2..8d379e8 100644 --- a/Sorting.py +++ b/Sorting.py @@ -69,6 +69,7 @@ def quickSort(data, start, end): def partition(data, start, end): '''Partition function for quick sort''' + #Uses the first item as the pivot pivotValue = data[start] lowIndex = start + 1 @@ -92,6 +93,7 @@ def partition(data, start, end): data[lowIndex] = data[highIndex] data[highIndex] = temp + #Swaps the pivotValue and high Index to split the list temp = data[start] data[start] = data[highIndex] data[highIndex] = temp