Update QuickSort.py
This commit is contained in:
12
QuickSort.py
12
QuickSort.py
@@ -110,12 +110,7 @@ def partition(array, low, high):
|
|||||||
i = low
|
i = low
|
||||||
j = high
|
j = high
|
||||||
while True:
|
while True:
|
||||||
|
|
||||||
iframe += 1
|
|
||||||
|
|
||||||
for cube in cubes:
|
|
||||||
cube.keyframe_insert(data_path="location", frame=iframe)
|
|
||||||
|
|
||||||
while array[i].scale.z < pivot.scale.z:
|
while array[i].scale.z < pivot.scale.z:
|
||||||
|
|
||||||
#add 1 to comparison counter
|
#add 1 to comparison counter
|
||||||
@@ -133,6 +128,11 @@ def partition(array, low, high):
|
|||||||
if i >= j:
|
if i >= j:
|
||||||
return j
|
return j
|
||||||
|
|
||||||
|
else:
|
||||||
|
iframe += 1
|
||||||
|
for cube in cubes:
|
||||||
|
cube.keyframe_insert(data_path="location", frame=iframe)
|
||||||
|
|
||||||
array[i].location.x = j
|
array[i].location.x = j
|
||||||
array[j].location.x = i
|
array[j].location.x = i
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user