【LeetCode】Binary Tree Postorder Traversal(二叉樹的後序遍歷)

這道題是LeetCode裏的第145道題。 題目要求: 給定一個二叉樹,返回它的 後序 遍歷。 示例: 輸入: [1,null,2,3] 1 \ 2 / 3 輸出: [3,2,1] 進階: 遞歸算法很簡單,你可以通過迭代算法完成嗎? 解題代碼: /** * Definition for a binary tree node. * struct Tr
相關文章
相關標籤/搜索