mirror of
https://github.com/CyC2018/Interview-Notebook.git
synced 2026-10-30 07:33:45 +00:00
Update 33. 二叉搜索树的后序遍历序列.md
重新绘制配图,示例改为 7 个节点的序列并说明左右子树的划分。
This commit is contained in:
@@ -6,9 +6,9 @@
|
||||
|
||||
输入一个整数数组,判断该数组是不是某二叉搜索树的后序遍历的结果。假设输入的数组的任意两个数字都互不相同。
|
||||
|
||||
例如,下图是后序遍历序列 1,3,2 所对应的二叉搜索树。
|
||||
例如,下图是后序遍历序列 1,3,2,5,7,6,4 所对应的二叉搜索树:最后一个元素 4 是根,前面小于 4 的 1,3,2 是左子树,大于 4 的 5,7,6 是右子树。
|
||||
|
||||
<div align="center"> <img src="https://cs-notes-1256109796.cos.ap-guangzhou.myqcloud.com/13454fa1-23a8-4578-9663-2b13a6af564a.jpg" width="150"/> </div><br>
|
||||
<div align="center"> <img src="pics/offer33-bst-postorder.png" width="440px"/> </div><br>
|
||||
|
||||
## 解题思路
|
||||
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 80 KiB |
Reference in New Issue
Block a user