@@ -0,0 +1,708 @@
+#!/usr/bin/python%0A# -*- encoding:utf-8 -*-%0A%0Adef sub_sort(array,low,high):%0A    key = array%5Blow%5D%0A    while low %3C high:%0A        while low %3C high and array%5Bhigh%5D %3E= key:%0A            high -= 1%0A        while low %3C high and array%5Bhigh%5D %3C key:%0A            array%5Blow%5D = array%5Bhigh%5D%0A            low += 1%0A            array%5Bhigh%5D = array%5Blow%5D%0A    array%5Blow%5D = key%0A    return low%0A%0A%0Adef quick_sort(array,low,high):%0A     if low %3C high:%0A        key_index = sub_sort(array,low,high)%0A        quick_sort(array,low,key_index)%0A        quick_sort(array,key_index+1,high)%0A%0A%0Aif __name__ == '__main__':%0A    array = %5B8,10,9,6,4,16,5,13,26,18,2,45,34,23,1,7,3%5D%0A    print array%0A    quick_sort(array,0,len(array)-1)%0A    %0A    print array%0A

Create py-快速排序.py