阅读背景:

树3. Tree Traversals Again (25)

来源:互联网 

An inorder binary tree traversal can be implemented in a non-recursive way with a stack. For example, suppose that when a 6-node binary tree (with the keys numbered from 1 to 6) is traversed, the stack operations are: push(1); push(2); push(3); pop(); pop(); push(4); pop(); pop(); push(5); push(6); pop(); pop(). Then a unique binary tree (shown in Figure 1) can be generated from this sequence of operations. Your task is to give the postorder traversal sequence of this tree.An inorder binary tree traversal can be implemen




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: