Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
|
|
@ -0,0 +1,24 @@
|
|||
def quickSort(arr)
|
||||
less = {}
|
||||
pivotList = {}
|
||||
more = {}
|
||||
if len(arr) <= 1
|
||||
return arr
|
||||
else
|
||||
pivot = arr[0]
|
||||
for i in arr
|
||||
if i < pivot
|
||||
less.append(i)
|
||||
else if i > pivot
|
||||
more.append(i)
|
||||
else
|
||||
pivotList.append(i)
|
||||
end
|
||||
end
|
||||
|
||||
less = quickSort(less)
|
||||
more = quickSort(more)
|
||||
|
||||
return less + pivotList + more
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue