#Inorder

94. Binary Tree Inorder Traversal

  https://www.cnblogs.com/grandyang/p/4297300.html用堆来辅助,先存储所有的左节点,再根据左节点找右节点classSolution{public:vector<int>inorderTraversal(TreeNode*root){vect...
代码星球 ·2020-10-13

leetcode 105. Construct Binary Tree from Preorder and Inorder Traversal,剑指offer 6 重建二叉树

不用迭代器的代码classSolution{public:TreeNode*reConstructBinaryTree(vector<int>pre,vector<int>vin){TreeNode*root=NULL;intlength_pre=pre.size();intlength_vin...