Binary Tree Inorder Traversa
来源:互联网 发布:淘宝二手苹果靠谱吗 编辑:程序博客网 时间:2024/06/03 12:53
/** * Definition for binary tree * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(NULL), right(NULL) {} * }; */class Solution { void InOrder(TreeNode *root,vector<int> &vec){ if(root==NULL)return; InOrder(root->left,vec); vec.push_back(root->val); InOrder(root->right,vec); }public: vector<int> inorderTraversal(TreeNode *root) { // Start typing your C/C++ solution below // DO NOT write int main() function vector<int> vec; InOrder(root,vec); return vec; }};
- Binary Tree Inorder Traversa
- [LeetCode] Binary Tree Inorder Traversa
- 94. Binary Tree Inorder Traversa
- [leetcode 94]Binary Tree Inorder Traversa
- Construct Binary Tree from Inorder and Postorder Traversa
- 145. Binary Tree Postorder Traversa
- leetcode-Binary Tree Zigzag Level Order Traversa
- Leetcode 314 Binary Tree Vertical Order Traversa
- 利用二叉树的中序遍历和后序遍历序列构造一个二叉树Search results for Construct Binary Tree from Inorder and Postorder Traversa
- Binary Tree Inorder Traversal
- Binary tree inorder iterator
- Binary Tree Inorder Traversal
- Binary Tree Inorder Traversal
- Binary Tree Inorder Traversal
- Binary Tree Inorder Traversal
- Binary Tree Inorder Traversal
- Binary Tree Inorder Traversal
- Binary Tree Inorder Traversal
- 编码与解码
- 暑假编程训练---K:判断是否直角三角形
- Windows2003 cmd下开启远程桌面服务
- 海量数据处理专题(四)——Bit-map
- hdu 1166 敌兵布阵(线段树基础题)
- Binary Tree Inorder Traversa
- 实验二:分页显示数据库信息(jsp页面直接分页)
- BMP图像格式详解
- 双链表(double_linked_list):(增、删、改、查、逆置)的C++的例子,稍微改一下,就成C。
- 技术之美[程序人生]我在IBM实习的日子
- java中Vector
- 暑假编程训练---L:求多项式
- sql 字符串分割求和
- hdu1017-A Mathematical Curiosity