Populating Next Right Pointers in Each Nod
Given a binary tree
struct TreeLinkNode {
TreeLinkNode *left;
TreeLinkNode *right;
TreeLinkNode *next;
}
Populate...
分类:
其他好文 时间:
2015-06-27 09:59:32
阅读次数:
114
just read it
smart_ptr: https://mbevin.wordpress.com/2012/11/18/smart-pointers/
move: https://mbevin.wordpress.com/2012/11/20/move-semantics/...
分类:
编程语言 时间:
2015-06-26 13:03:36
阅读次数:
237
1. 初始化的区别:有空指针(NULL),但没有空引用,和const变量一样,引用一旦定义就必须和对象绑定。(当然char* pc=0;char& rc=*pc;也合法但无意义) 由此造成的影响: 1) dynamic_cast,对于指针的down_cast,如果失败就返回空指针,但由于没...
分类:
编程语言 时间:
2015-06-25 22:52:48
阅读次数:
136
Given a linked list, determine if it has a cycle in it.Follow up:Can you solve it without using extra space?Hide TagsLinked ListTwo Pointers分析:经典的快慢指针...
分类:
其他好文 时间:
2015-06-23 17:44:18
阅读次数:
99
题目链接:https://leetcode.com/problems/3sum-closest/
Given an array S of n integers, find three integers in S such that the sum is closest to a given number, target. Return the sum of the three i...
分类:
其他好文 时间:
2015-06-22 17:56:00
阅读次数:
110
题目链接:https://leetcode.com/problems/3sum/
Given an array S of n integers, are there elements a, b, c in S such that a + b + c =
0? Find all unique triplets in the array which gives the sum o...
分类:
其他好文 时间:
2015-06-22 17:55:41
阅读次数:
90
Description:Given a binary tree struct TreeLinkNode { TreeLinkNode *left; TreeLinkNode *right; TreeLinkNode *next; }Populate each...
分类:
其他好文 时间:
2015-06-20 16:57:34
阅读次数:
74
Description:Follow up for problem "Populating Next Right Pointers in Each Node".What if the given tree could be any binary tree? Would your previous s...
分类:
其他好文 时间:
2015-06-20 16:53:04
阅读次数:
79
Unique pointer:
Manages the storage of a pointer, providing a limited garbage-collection facility, with little to no overhead over built-in pointers (depending on the deleter used).
These obje...
分类:
其他好文 时间:
2015-06-18 22:20:18
阅读次数:
182
Populating Next Right Pointers in Each NodeGiven a binary tree struct TreeLinkNode { TreeLinkNode *left; TreeLinkNode *right; TreeLi...
分类:
编程语言 时间:
2015-06-17 00:30:04
阅读次数:
137