题目:把一个数组最开始的若干个元素搬到数组的末尾,我们称之为数组的旋转。输入一个递增排序的数组的一个旋转,输出旋转数组的最小元素。例如数组{3,4,5,1,2}为{1,2,3,4,5}的一个旋转,该数组的最小值为1。参见Leetcode-Find Minimum in Rotated Sorted ...
分类:
编程语言 时间:
2015-06-30 21:39:50
阅读次数:
163
获取Select :获取select 选中的 text : $("#ddlRegType").find("option:selected").text();获取select选中的 value: $("#ddlRegType ").val();获取select选中的索引: $("#ddlR...
分类:
Web程序 时间:
2015-06-30 20:16:23
阅读次数:
136
Each time we find a match, increase the global counter by 1.For KMP, algorithm, you may refer to the following links which have nice explanations.KMP ...
分类:
编程语言 时间:
2015-06-30 19:56:33
阅读次数:
142
// 给一组数,有两个数只出现了一次,其他所有数都是成对出现的。找出这两个数。
#include
void find_two_diff(int arr[], int len, int *num1, int *num2)//设置两个返回型参数
{
int i = 0;
int ret = 0;
int pos = 1;
*num1 = 0;
*num2 = 0;
for (i =...
分类:
编程语言 时间:
2015-06-30 18:34:32
阅读次数:
124
223 Rectangle Area链接:https://leetcode.com/problems/rectangle-area/
问题描述:
Find the total area covered by two rectilinear rectangles in a 2D plane.Each rectangle is defined by its bottom left corner...
分类:
其他好文 时间:
2015-06-30 16:24:49
阅读次数:
88
//给?组组数,只有两个数只出现了一次,其他所有数都是成对出现的,找出这两个数。
#include
int find_one_pos(int num) //找一个为为1的位置
{
int n = 0;
while(num)
{
if (num & 1 == 1)
break;
else
{
n++;
num >>= 1;
}
}
return...
分类:
编程语言 时间:
2015-06-30 16:22:48
阅读次数:
105
// 给一组数,只有一个数只出现了一次,其他所有数都是成对出现的。找出这个数
#include
int find_one(int arr[], int len)
{
int i = 0;
int ret = 0;
for (; i < len; ++i)
{
ret ^= arr[i];
}
return ret;
}
int main()
{
int arr[] = ...
分类:
编程语言 时间:
2015-06-30 16:18:43
阅读次数:
116
题目连接http://acm.hdu.edu.cn/showproblem.php?pid=2645find the nearest stationDescriptionSince dandelion has left the hometown so long,she finds it's diff...
分类:
其他好文 时间:
2015-06-30 16:15:07
阅读次数:
92
为了测试caffe,准备了一堆图片准备测试。前面进行了重命名的操作准备,现在需要将文件名全部读取出来生成txt作为标签使用。此过程用到了find命令和sed命令。先看效果图当然还有后续处理,就是在所有文件名后打上标签序号,这个就是sed命令的作用了,此处我也做成了sh文件,方便使用,代码如下,自行参考修改使用吧。
> 自己写的create_filelist.sh文件,如下train_file=tes...
分类:
系统相关 时间:
2015-06-30 15:05:53
阅读次数:
958
题目:LeetCode 005 Longest Palindromic SubstringGiven a string S, find the longest palindromic substring in S. You may assume that the maximum length of ...
分类:
其他好文 时间:
2015-06-30 14:49:25
阅读次数:
108