LintCode:整数排序
来源:互联网 发布:王阳明 知乎 编辑:程序博客网 时间:2024/05/16 19:29
LintCode:整数排序
class Solution: # @param {int[]} A an integer array # @return nothing def sortIntegers2(self, A): # Write your code here i = 0 j = len(A) - 1 self.quick_sort(A, i, j) def quick_sort(self, A, low, high): if low < high: i = low j = high tmp = A[low] while i < j: while i < j and A[j] >= tmp: j -= 1 A[i] = A[j] while i < j and A[i] < tmp: i += 1 A[j] = A[i] A[i] = tmp self.quick_sort(A, low, i-1) self.quick_sort(A, i+1, high)
0 0
- LintCode:整数排序
- 【LintCode】整数排序II
- LintCode【入门】整数排序
- 整数排序II-lintcode
- lintcode-入门-整数排序
- Lintcode 463 整数排序
- LintCode-整数排序
- LintCode-整数排序 II
- 整数排序-LintCode
- LintCode 整数排序
- LintCode 整数排序 II
- LintCode 整数排序
- Lintcode整数排序
- 整数排序-LintCode
- 整数排序 II -LintCode
- lintcode 463整数排序 lintcode 464整数排序II
- [LintCode] Sort Integers 整数排序
- Lintcode——整数排序
- 二叉树的序号(poj 二叉树)
- 欢迎来到本人iOS博客
- UICollectionViewLayout
- JavaScript设计模式----策略模式
- 块元素和行内元素比较
- LintCode:整数排序
- 动态链接库的优缺点
- android测试类
- 剑指offer面试题:求二叉树的镜像(递归、循环解法及测试用例)
- 在 Cent OS 7 上搭建带着 PHP 7 和 Memcached 的 LAMP
- HDU4349->Lucas定理
- DPI和PPI区别
- Service的使用(四)前台服务与AIDL
- Chromium为视频标签<video>创建播放器的过程分析