add post-order traversal picture to chp5.md.

This commit is contained in:
Shine wOng
2019-06-02 13:31:08 +08:00
parent 74801a2c4d
commit 24fd74d53c
2 changed files with 4 additions and 0 deletions

View File

@@ -270,6 +270,10 @@ void BinNode<T>::inOrder_It2(VST &visit) {
+ 当前结点是左结点。则弹栈的结点是当前结点的右结点。对右结点的处理应该继续迭代地访问右结点的最高左侧可见结点。
+ 当前结点是右结点。则弹栈的结点是当前结点的父结点。此时应该访问当前结点,然后直接进入下一步的迭代,再次进行弹栈操作。
后续遍历的访问过程如下图所示:
![后续遍历的访问过程]()
综上所述,后序遍历的非递归算法如下:
```cpp

Binary file not shown.

After

Width:  |  Height:  |  Size: 204 KiB