Given a binary tree and a sum, find all root-to-leaf paths where each path's sum equals the given sum.For example:Given the below binary tree andsum =...
分类:
其他好文 时间:
2015-06-18 00:36:46
阅读次数:
69
1.CTRL+SHIFT+F (Find in files),打开查找功能(如果打不开查看本文最后)2. 勾选 使用:正则表达式,3.搜索内容: ^:b*[^:b#/]+.*$#开头和/开头或者空行都不计入代码量。^:b*[^:b#/*]+.*$*开头和#开头和/开头或者空行都不计入代码量。4.最后...
分类:
其他好文 时间:
2015-06-17 23:21:06
阅读次数:
220
题目:Given an array of integers, find two numbers such that they add up to a specific target number.The function twoSum should return indices of the two...
分类:
其他好文 时间:
2015-06-17 22:56:23
阅读次数:
192
string类的查找函数: int find(char c, int pos = 0) const;//从pos开始查找字符c在当前字符串的位置int find(const char *s, int pos = 0) const;//从pos开始查找字符串s在当前串中的位置int find(const char *s, int pos, int n) const;//从pos开始查找字符串s中前n个...
分类:
编程语言 时间:
2015-06-17 21:44:40
阅读次数:
163
Contains Duplicate III
Given an
array of integers, find out whether there are two distinct indices i and j in
the array such that the difference between nums[i] and nums[j] is
at most t and
t...
分类:
其他好文 时间:
2015-06-17 21:37:57
阅读次数:
117
同事在一台机器上新安装的CentOS,我拷贝一个项目在上面编译,老是报如下错误:“/usr/bin/ld: cannot find -lz”说明:libz.so是有的,在/lib64下面我设置环境变量LD_LIBRARY_PATH或者使用-L/lib64都不管用,最后使用的方法是在/usr/lib6...
分类:
其他好文 时间:
2015-06-17 18:09:12
阅读次数:
83
【摘要】最近两个月都在学习 Linux 驱动,中间碰到了很多问题,进度比较缓慢。尽管不是班科出生的,但是还是觉得算法很有必要学一学。因此将数组元素查找作为自己算法开篇的第一篇博客,好好跟着平凡程序员的博客学习,内容基本是拿来主义。
我们可以下面一个数组查找的函数说起。一句一句写起,首先我们开始从最简单的函数构造开始
int find(int array[], int length, int value)
{
int index = 0;
return index;
}
这里看到,查找函数只是一个...
分类:
编程语言 时间:
2015-06-17 16:40:40
阅读次数:
150
Given a stringS, find the longest palindromic substring inS. You may assume that the maximum length ofSis 1000, and there exists one unique longest pa...
分类:
其他好文 时间:
2015-06-17 15:16:35
阅读次数:
140
There are two sorted arraysnums1andnums2of size m and n respectively. Find the median of the two sorted arrays. The overall run time complexity should...
分类:
其他好文 时间:
2015-06-17 15:09:16
阅读次数:
111
Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeating letters fo...
分类:
其他好文 时间:
2015-06-17 14:57:56
阅读次数:
111