Skip to content
Permalink
Browse files
Added Comments
  • Loading branch information
hortonr6 committed Jul 22, 2019
1 parent 27d7d22 commit 106155202d239efebb7dc88871c5c64b8c00d9de
Showing 1 changed file with 2 additions and 0 deletions.
@@ -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

0 comments on commit 1061552

Please sign in to comment.