在链接之后,我修改了代码以构建一个二叉树,给出了postorder和无序遍历。但是输出似乎产生了一些垃圾值。我不明白我哪里出了问题。前置遍历在开头有根,后置遍历在末尾有根。使用这种逻辑,我修改了代码。of the build tree (using preorder traversal) is : D B E A F C
The inorder traversal of the build tree(using postordertraversal) is : D B I R O 7 = R N
It is possible to define both preorder and postorder for general trees, you visit the subtrees of the root, in left to right order,
Thus the example above would yield the foll
traversal on this binary tree by calling *postordertraversallist for use in this traversalprotected void postorder (BinaryTreeNode<T> node, ArrayUnorderedList= null)