[leetcode]Given a binary tree, flatten it to a linked list in-place....
分类:
其他好文 时间:
2014-10-17 12:03:13
阅读次数:
119
Flatten Binary Tree to Linked List
Total Accepted: 25034 Total
Submissions: 88947My Submissions
Given a binary tree, flatten it to a linked list in-place.
For example,
Given
1...
分类:
其他好文 时间:
2014-10-11 20:54:36
阅读次数:
214
大象放入冰箱几步的思路处理这问题就好了
1.把左子树弄平, 2. 插入到根节点和根节点的右子树之间,3. 重复1,2
思路不难,代码上有点混乱,细节实现是:把root的左子树弄成flatten的 flatten(root.left),把右子树保存起来 temp=root.right,让root.right=root.left, 然后断掉左边,root.left=null.
然后一直走到右边的...
分类:
其他好文 时间:
2014-10-07 06:20:13
阅读次数:
194
Given a binary tree, flatten it to a linked list in-place.
For example,
Given
1
/ 2 5
/ \ 3 4 6
The flattened tree should look like:
1
...
分类:
其他好文 时间:
2014-10-02 15:12:43
阅读次数:
193
Given a binary tree, flatten it to a linked list in-place.For example,Given 1 / \ 2 5 / \ \ 3 4 6The flattened t...
分类:
其他好文 时间:
2014-09-16 04:57:10
阅读次数:
134
Given a binary tree, flatten it to a linked list in-place.For example,Given 1 / \ 2 5 / \ \ 3 4 6The flattened t...
分类:
其他好文 时间:
2014-09-13 22:39:06
阅读次数:
238
Problem Description:
Given a binary tree, flatten it to a linked list in-place.
For example,
Given
1
/ 2 5
/ \ 3 4 6
The flattened tree s...
分类:
其他好文 时间:
2014-09-05 19:57:31
阅读次数:
205
scipy在misc的pilutil.py中def fromimage(im, flatten=0)函数中,# workaround for crash in PIL, see #1613.im.convert('L')上面是之前的代码,当图片模式是二值模式时,此处会出错,因为im.convert(...
分类:
编程语言 时间:
2014-08-29 10:33:57
阅读次数:
204