题目: Given a linked list, return the node where the
cycle begins. If there is no cycle, returnnull. Follow up: Can you solve it
without using extr...
分类:
其他好文 时间:
2014-05-16 04:50:13
阅读次数:
329
/*
函数:可以有返回值得命名的PL/SQL子程序,必须有返回值
关键字:function return
*/...
分类:
数据库 时间:
2014-05-15 14:49:18
阅读次数:
359
【题目】
You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbers and return it as a linked list.
Input: (2 -> 4 -> 3) + (5 -> 6 -> 4)
Out...
分类:
其他好文 时间:
2014-05-15 05:13:49
阅读次数:
306
本文为senlie原创,转载请保留此地址:http://blog.csdn.net/zhengsenlie
Binary Tree Preorder Traversal
Total Accepted: 17948 Total
Submissions: 51578
Given a binary tree, return the preorder tra...
分类:
其他好文 时间:
2014-05-15 04:37:26
阅读次数:
283
水题。
描述的还挺麻烦的,实际上就是纸老虎,用两个string,一个存上一轮的结果,一个用来更新出这一轮的结果,每次扫描上一轮,统计一个字符出现的次数,然后把这个次数和字符加入到这一轮的字符串中就可以了。
class Solution {
public:
string countAndSay(int n) {
if(n == 0) return "";
...
分类:
其他好文 时间:
2014-05-15 04:12:07
阅读次数:
289
还没有处理lambda、上下文等,有待完善。
main
{
for
putsl(eval(getsl))
}
rstr eval(rstr s)
{
s=tokenize(s)
v=s.split(' ')
if v.get(0)!='('
return v.get(0)
next=find(v.sub(2))+2
switch v.get(1)
case '+'
r...
分类:
其他好文 时间:
2014-05-14 15:32:34
阅读次数:
323
题目一:
Given a string s, partition s such that every substring of the partition is a palindrome.
Return all possible palindrome partitioning of s.
For example, given s = "aab",
Return
[
...
分类:
其他好文 时间:
2014-05-14 15:10:01
阅读次数:
293
/*
* hdu 最小公倍数
* date 2014/5/13
* state AC
*/
#include
using namespace std;
int gcd(int x,int y)
{
while(x!=y)
{
if(x>y)x=x-y;
else y=y-x;
}
return x;
}
int main()
...
分类:
其他好文 时间:
2014-05-14 14:29:59
阅读次数:
225
网上转载的一段代码,留着以后用,js文件://判断输入密码的类型 function
CharMode(iN){ if (iN>=48 && iN =65 && iN =97 && iN
>>=1; } return modes; } //返回强度级别 function chec...
分类:
Web程序 时间:
2014-05-14 13:32:27
阅读次数:
387
在学习Stl的过程中,经常看到->符号的重载,但一直不太明白。
今天做了一个小测试,来看看如果调用它。 以list的迭代器为例,在 pointer operator->() const { return
&(operator*());}中加入 cout str_list; str_list.push...
分类:
其他好文 时间:
2014-05-14 10:32:52
阅读次数:
221