利用hash table, two pointers, string的题目。1.求最长不重复子串的长度hash table体现在一个数组,下标是字符串中元素的ASCII值,下标对应的元素代表该元素在字符串中出现的位置。two pointers体现在用i一步步向前移去遍历字符串中的元素,作为不重复子串...
分类:
其他好文 时间:
2015-04-23 23:01:47
阅读次数:
131
题目来自:LeetCode
https://leetcode.com/problems/populating-next-right-pointers-in-each-node/
Given a binary tree
struct TreeLinkNode {
TreeLinkNode *left;
TreeLinkNode *right;
...
分类:
其他好文 时间:
2015-04-23 13:22:50
阅读次数:
143
METHOD 1:Consider the case where we do not know the number of elements in each row at compile time, i.e. both the number of rows and number of columns...
分类:
其他好文 时间:
2015-04-18 17:30:37
阅读次数:
124
Given a binary tree struct TreeLinkNode { TreeLinkNode *left; TreeLinkNode *right; TreeLinkNode *next; }Populate each next pointe...
分类:
其他好文 时间:
2015-04-15 23:02:52
阅读次数:
114
Given a binary tree struct TreeLinkNode { TreeLinkNode *left; TreeLinkNode *right; TreeLinkNode *next; }Populate each next pointe...
分类:
其他好文 时间:
2015-04-15 18:28:59
阅读次数:
137
题目:
Follow up for problem "Populating Next Right Pointers in Each Node".
What if the given tree could be any binary tree? Would your previous solution still work?
Note:
You may only us...
分类:
其他好文 时间:
2015-04-11 11:53:04
阅读次数:
192
题目:
Given a binary tree
struct TreeLinkNode {
TreeLinkNode *left;
TreeLinkNode *right;
TreeLinkNode *next;
}
Populate each next pointer to point to its next right n...
分类:
其他好文 时间:
2015-04-11 00:07:02
阅读次数:
170
Follow up for problem "Populating Next Right Pointers in Each Node".What if the given tree could be any binary tree? Would your previous solution stil...
分类:
其他好文 时间:
2015-04-10 19:33:42
阅读次数:
102
Given a binary tree struct TreeLinkNode { TreeLinkNode *left; TreeLinkNode *right; TreeLinkNode *next; }Populate each next pointe...
分类:
其他好文 时间:
2015-04-10 17:25:22
阅读次数:
110