class quick:
def partition(self, arr, low, high):
temp = arr[low]
flag = low
t = low
for i in range(low, high):
if arr[i] > temp:
temp1 = arr[flag]
arr[flag] = arr[i]
arr[i] = temp1
flag += 1
t = i
arr[t] = arr[flag]
arr[flag] = temp
return flag
def quickSort(self, arr, low, high):
if low < high:
flag = self.partition(arr,low,high)
self.quickSort(arr,low,flag)
self.quickSort(arr,flag+1,high)
return arr
example = [0,-1,0,-1,0,3, 2, 3, 4, 4345, 6, 557, 2, 8768, 7, 0, 8, 435, 3, 3, 1]
obj = quick()
print obj.quickSort(example,0,len(example))