LintCode-剑指Offer-(159)寻找旋转排序数组中的最小值
来源:互联网 发布:动画影视制作软件 编辑:程序博客网 时间:2024/04/27 00:26
class Solution {
public:
/**
* @param num: a rotated sorted array
* @return: the minimum number in the array
// write your code here
int tmpmin = num[0];
for ( int i = 1; i < num.size( ); i++ ){
if ( tmpmin>num[i] )
tmpmin = num[i];
}
return tmpmin;
}
};
public:
/**
* @param num: a rotated sorted array
* @return: the minimum number in the array
*/
//这个没有技巧,直接遍历
int findMin(vector<int> &num) {// write your code here
int tmpmin = num[0];
for ( int i = 1; i < num.size( ); i++ ){
if ( tmpmin>num[i] )
tmpmin = num[i];
}
return tmpmin;
}
};
0 0
- LintCode-剑指Offer-(159)寻找旋转排序数组中的最小值
- LintCode-剑指Offer-(28)寻找旋转排序数组中的最小值
- LintCode-寻找旋转排序数组中的最小值
- LintCode 寻找旋转排序数组中的最小值
- LintCode-寻找旋转排序数组中的最小值
- lintcode 寻找旋转排序数组中的最小值
- lintcode,寻找旋转排序数组中的最小值
- lintcode,寻找旋转排序数组中的最小值
- LintCode : 寻找旋转排序数组中的最小值
- lintcode--寻找旋转排序数组中的最小值
- 寻找旋转排序数组中的最小值-LintCode
- LintCode-剑指Offer-(160)寻找旋转排序数组中的最小值Ⅱ
- lintcode- 寻找旋转排序数组中的最小值-159
- LintCode-寻找旋转排序数组中的最小值 II
- 寻找旋转排序数组中的最小值——LintCode
- lintcode 160 寻找旋转排序数组中的最小值 II
- Lintcode 寻找旋转排序数组中的最小值 II
- [LintCode]159.寻找旋转排序数组中的最小值
- linux下开发之makefile文件
- Webkit之JSC Binding解析
- 边做边学Rust之原生数据类型
- ajax 滚动刷新
- C++容器练习代码【加网友分享】
- LintCode-剑指Offer-(159)寻找旋转排序数组中的最小值
- html5之phonegap环境搭建、创建项目(一)
- 用小规模器件实现QC2.0从机握手协议欺骗
- python父线程关闭后子线程不关闭问题
- C++面试题之容器
- MySQL中merge表存储引擎用法
- C++ 容器vector 语法练习
- 应用程序启动速度优化Static Initializer
- 写代码安静与专注的重要性