[leetcode]145-二叉树的后序遍历

马谦马谦马谦 数据结构和算法评论201字数 353阅读1分10秒阅读模式

来源:力扣(LeetCode)

链接:https://leetcode-cn.com/problems/binary-tree-postorder-traversal

著作权归领扣网络所有。商业转载请联系官方授权,非商业转载请注明出处。

一、题目描述

给定一个二叉树,返回它的 后序 遍历。

例如输入[1,null,2,3] :

输出:

进阶: 递归算法很简单,你可以通过迭代算法完成吗?

二、题解

参考:二叉树的后序遍历

三、代码

3.1 通过栈+链表实现

[leetcode]145-二叉树的后序遍历

3.2 通过2次压栈实现

 
马谦马谦马谦
  • 本文由 马谦马谦马谦 发表于 2020年2月9日14:01:20
  • 转载请务必保留本文链接:https://www.dyxmq.cn/program/algorithms/leetcode145-binary-tree-postorder-traversal.html
匿名

发表评论

匿名网友
:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:
确定

拖动滑块以完成验证