CodePudding user response:
Sequence traversal recursive traversal first namely after its left subtree, then the recursive traversal its right subtree, then access the node,CodePudding user response:
//to traverse the root node of the left subtree, then traverse of the root node right subtree, then access to the root node,
//subsequent traversal recursive algorithm:
Void PostOrder (NoteRoot)
{
//the root node is empty return
If (root==null) return;
PostOrder (root. LChild);//subsequent traversal left subtree
PostOrder (root. RChild);//subsequent traversal right subtree
//deal with the root node
Printf (" % d ", a root. The Data).
}