94. 二叉树的中序遍历

最开始的代码,用了递归,虽然通过了,但是很别扭。 vector<int> ans; class Solution { public: vector<int> inorderTraversal(TreeNode* root) { ans.clear(); inorder(root); return ans; } void ino
相关文章
相关标签/搜索