快速排序非递归实现--python

主要思想是:每次把待排序数组分为两部分,左边小于轴右边大于轴,把分开的数组的收尾数组的索引存到辅助栈空间里,替换递归。两种思路:python 思路一:严老师数据结构里面的思路算法 def partition(nums,low,high): high_flag = True low_flag = False pivot = nums[low]
相关文章
相关标签/搜索