https://www.cnblogs.com/grandyang/p/4297300.html
用堆来辅助,先存储所有的左节点,再根据左节点找右节点
class Solution { public: vector<int> inorderTraversal(TreeNode* root) { vector<int> result; stack<TreeNode*> container; while(root || !container.empty()){ while(root){ container.push(root); root = root->left; } root = container.top(); container.pop(); result.push_back(root->val); root = root->right; } return result; } };