参考:http://www.geeksforgeeks.org/inorder-tree-traversal-without-recursion-and-without-stack/
1. Initialize current as root
2. While current is not NULL
If current does not have left child
a)...
分类:
其他好文 时间:
2014-10-22 14:38:08
阅读次数:
187
INSERT INTO video_tag_all(tagname,ctime) SELECT '利物浦',1413954816 FROM video_tag_all WHERE (SELECT last_insert_id(id) FROM video_tag_all WHER...
分类:
数据库 时间:
2014-10-22 14:15:11
阅读次数:
210
Call Vibrator requires the radio log of phone to detect when outgoing call is answered. But since Android JellyBean(4.1), the permission for radio log...
分类:
其他好文 时间:
2014-10-22 06:18:03
阅读次数:
260
Given a linked list, determine if it has a cycle in it.Follow up:Can you solve it without using extra space?注意,链表循环并不是尾指针和头指针相同,可能是在中间某一段形成一个环路,所以不能只判...
分类:
其他好文 时间:
2014-10-21 22:56:24
阅读次数:
335
Problem Description
The French author Georges Perec (1936–1982) once wrote a book, La disparition, without the letter 'e'. He was a member of the Oulipo group. A quote from the book:
Tout avait Pa...
分类:
其他好文 时间:
2014-10-21 21:44:00
阅读次数:
217
题目描述:Given a singly linked listL:L0→L1→…→Ln-1→Ln,reorder it to:L0→Ln→L1→Ln-1→L2→Ln-2→…You must do this in-place without altering the nodes' values.For...
分类:
其他好文 时间:
2014-10-21 17:20:39
阅读次数:
180
Divide two integers without using multiplication, division and mod operator.分析:题目意思很容易理解,就是不用乘除法和模运算求来做除法,很容易想到的一个方法是一直做减法,然后计数,超时。在网上找到一种解法,利用位运算,意思是...
分类:
其他好文 时间:
2014-10-21 02:10:36
阅读次数:
185
回文数字。玩过回文字符串之后在玩一个回文数字,相比于最长回文字符串的巧妙,这道题目唯一值得称道的地方可能就是那句Do this without extra space,可以说这是这道题目明面上给出的唯一束缚,当然如果要是看了提示的话,会发现输入的整数是有负整数的可能。也就是说还要处理负数的问题,在这...
分类:
其他好文 时间:
2014-10-21 00:47:55
阅读次数:
204
Divide two integers without using multiplication, division and mod operator.分析:不能用乘、除、取模运算,我们可以用的运算还有加、减、位运算。一个比较简单的想法是在dividend上不断减去divisor,知道余数小于div...
分类:
其他好文 时间:
2014-10-20 21:18:28
阅读次数:
183
题目:Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeating letters...
分类:
其他好文 时间:
2014-10-20 21:11:05
阅读次数:
203