码迷,mamicode.com
首页 >  
搜索关键字:flatten    ( 362个结果
leetcode - Flatten Binary Tree to Linked List
题目:Flatten Binary Tree to Linked ListGiven a binary tree, flatten it to a linked list in-place.For example,Given 1 / \ 2 5 ...
分类:其他好文   时间:2014-06-24 09:09:02    阅读次数:147
[LeetCode] Flatten Binary Tree to Linked List
1 迭代,重要关系 p->right = s.top(); 1 class flat{ 2 public: 3 void flatten(TreeNode* root) { 4 if (root == NULL) return; 5 ...
分类:其他好文   时间:2014-06-14 16:50:41    阅读次数:172
leetcode--Flatten Binary Tree to Linked List
Given a binary tree, flatten it to a linked list in-place.For example,Given 1 / \ 2 5 / \ \ 3 4 6The flattened t...
分类:其他好文   时间:2014-06-13 15:11:35    阅读次数:273
【leetcode】Flatten Binary Tree to Linked List
分析: 问题是将给定的二叉树变换成令一种形式,这种类型的问题,其模式是,将左子树变换成某种形式,右子树也变换成这种形式,然后再与根结点按规定的方式连接起来,那么整体就变换完成了。这个题我们就可以采用这种形式,麻烦的地方就是在进行连接的时候,我们假设根为root,左子树变换后的根为root_left,右子树变换后的根为 root_right,那么连接的时候应该是root->right = root...
分类:其他好文   时间:2014-06-10 07:27:10    阅读次数:201
Leetcode::Flatten Binary Tree to Linked List
Description:Given a binary tree, flatten it to a linked list in-place.For example,Given 1 / \ 2 5 / \ \ 3 4 6The...
分类:其他好文   时间:2014-06-08 18:34:52    阅读次数:214
LeetCode: Flatten Binary Tree to Linked List [114]
【题目】 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 2 3 4 \...
分类:其他好文   时间:2014-06-07 11:37:00    阅读次数:153
Flatten Binary Tree to Linked List
Given a binary tree, flatten it to a linked list in-place.For example,Given 1 / \ 2 5 / \ \ 3 4 6The flattened t...
分类:其他好文   时间:2014-05-30 16:15:02    阅读次数:224
leetcode -- Flatten Binary Tree to Linked List
算法:1. 对root的左子树做处理,让左子树的根节点作为,根节点的右子树,并让右子树作为左子树根节点的右子树的子树2. 递归遍历右子树public void flatten(TreeNode root) { if(root==null){ return; ...
分类:其他好文   时间:2014-05-26 23:39:49    阅读次数:253
leetcode -day17 Path Sum I II & Flatten Binary Tree to Linked List & Minimum Depth of Binary Tree
1、 ?? Path Sum Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the given sum. For example: Given the below...
分类:其他好文   时间:2014-05-18 03:25:06    阅读次数:301
[leetcode]Flatten Binary Tree to Linked List @ Python
原题地址:http://oj.leetcode.com/problems/flatten-binary-tree-to-linked-list/题意:Given a binary tree, flatten it to a linked list in-place.For example,Given...
分类:编程语言   时间:2014-05-12 05:30:32    阅读次数:367
362条   上一页 1 ... 34 35 36 37 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!