- 博客(12)
- 收藏
- 关注
原创 二叉树的层次遍历 II - C++
class Solution { /** * @param root : The root of binary tree. * @return : buttom-up level order a list of lists of integer */public: stack> a; vector> b; queue q; v
2017-04-23 18:39:54 357
原创 二叉树 最大最小深度
class Solution {public: /** * @param root: The root of binary tree. * @return: An integer */ int maxx=0; void look(TreeNode *root,int i) { if(root==NULL)
2017-04-23 18:39:13 207
原创 把排序数组转换为高度最小的二叉搜索树 - C++
class Solution {public: /** * @param A: A sorted (increasing order) array * @return: A tree node */ TreeNode *x; bool xxx=1; void look(TreeNode *&x,int minn,int maxx
2017-04-23 18:38:07 249
原创 克隆二叉树 - C++
class Solution {public: /** * @param root: The root of binary tree * @return root of new tree */ void look (TreeNode *root,TreeNode *&x) { if(root==NULL)
2017-04-23 18:37:03 611
原创 子树
class Solution {public: /** * @param T1, T2: The roots of binary tree. * @return: True if T2 is a subtree of T1, or false. */ bool nua; bool xx; bool trade(TreeNo
2017-04-23 18:30:07 203
原创 翻转二叉树 - C++
class Solution {public: /** * @param root: a TreeNode, the root of the binary tree * @return: nothing */ void look(TreeNode *root) { if(root==NULL) retu
2017-04-23 18:28:45 1095
原创 将二叉树拆成链表 - C++
class Solution {public: /** * @param root: a TreeNode, the root of the binary tree * @return: nothing */ // TreeNode *x; // x=new TreeNode; vector a; void look(Tre
2017-04-23 18:28:02 209
原创 等价二叉树
class Solution {public: /** * @aaram a, b, the root of binary trees. * @return true if they are identical, or false. */ bool x; bool trade(TreeNode *A) { if
2017-04-23 18:26:56 218
原创 二叉树的路径和 - C++
class Solution {public: /** * @param root the root of binary tree * @param target an integer * @return all valid paths */ vector> a; vector b; int sum; int
2017-04-23 18:24:55 447
原创 二叉树的多种 顺序遍历
//中序class Solution { /** * @param root: The root of binary tree. * @return: Inorder in vector which contains node values. */public: vector a; void look(TreeNode *root)
2017-04-20 17:32:41 260
原创 二叉树的所有路径 - C++
#includeclass Solution {public: /** * @param root the root of the binary tree * @return all root-to-leaf paths */ vector a; vector a1[200]; vector ::iterator b1;
2017-04-20 17:21:07 662
原创 二叉树的最大节点 - C++
class Solution {public: /** * @param root the root of binary tree * @return the max node */ TreeNode *final; void look(TreeNode* root) { if(root==NULL) r
2017-04-20 17:18:23 619
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人