mirror of
https://github.com/krahets/hello-algo.git
synced 2025-07-06 22:34:18 +08:00
Update quick_sort.py
This commit is contained in:
@ -12,6 +12,7 @@ sys.path.append(osp.dirname(osp.dirname(osp.abspath(__file__))))
|
|||||||
|
|
||||||
""" 快速排序类 """
|
""" 快速排序类 """
|
||||||
class QuickSort(object):
|
class QuickSort(object):
|
||||||
|
|
||||||
""" 哨兵划分 """
|
""" 哨兵划分 """
|
||||||
def partition(self, nums, left, right):
|
def partition(self, nums, left, right):
|
||||||
# 以 nums[left] 作为基准数
|
# 以 nums[left] 作为基准数
|
||||||
|
Reference in New Issue
Block a user