乍一看很难,理清思路后很简单的。/** * Definition for binary tree with next pointer. * struct TreeLinkNode { * int val; * TreeLinkNode *left, *right, *next; * TreeL...
分类:
其他好文 时间:
2015-08-21 10:59:05
阅读次数:
160
题目:Given a binary tree struct TreeLinkNode { TreeLinkNode *left; TreeLinkNode *right; TreeLinkNode *next; }Populate each next poi...
分类:
其他好文 时间:
2015-08-19 20:15:37
阅读次数:
91
题目
Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without
repeating letters for "abcabcbb" is "abc", which the length is 3...
分类:
其他好文 时间:
2015-08-17 06:33:30
阅读次数:
232
Given a binary tree
struct TreeLinkNode {
TreeLinkNode *left;
TreeLinkNode *right;
TreeLinkNode *next;
}
Populate each next pointer to point to its next right node....
分类:
其他好文 时间:
2015-08-15 20:10:22
阅读次数:
119
??Pointers to classesObjects can also be pointed to by pointers: Once declared, a class becomes a valid type, so it can be used as the type pointed to...
分类:
其他好文 时间:
2015-08-15 13:30:24
阅读次数:
95
这两个名字不同当然所代表的意思也就不同。我刚开始看到这就吓到了,主要是中文太博大精深了,整这样的简称太专业了,把人都绕晕了。从英文解释或中文全称看就比较容易理解。指针数组:array of pointers,即用于存储指针的数组,也就是数组元素都是指针数组指针:a pointer to an arr...
分类:
编程语言 时间:
2015-08-14 18:31:57
阅读次数:
128
Question: What is a Pointer? What are its limitations? What are its benefits? How do we use it? What all operation we can perform using it? In this ar...
分类:
其他好文 时间:
2015-08-13 17:36:54
阅读次数:
110
【117-Populating Next Right Pointers in Each Node(二叉树链接右指针II)】【LeetCode-面试算法经典-Java实现】【所有题目目录索引】原题 Follow up for problem “Populating Next Right Pointers in Each Node”.
What if the given tree could b...
分类:
编程语言 时间:
2015-08-13 07:47:20
阅读次数:
156
Given a linked list, swap every two adjacent nodes and return its head.For example,Given1->2->3->4, you should return the list as2->1->4->3.Your algor...
分类:
其他好文 时间:
2015-08-12 23:10:02
阅读次数:
92
Populating Next Right Pointers in Each Node II
Follow up for problem "Populating Next Right Pointers in Each Node".
What if the given tree could be any binary tree? Would your previous solutio...
分类:
其他好文 时间:
2015-08-12 16:51:54
阅读次数:
112