Home > Back-end >  After the clues to the binary tree
After the clues to the binary tree

Time:10-27

Excuse me each great spirit, "reference sequence clues in binary tree class templates, designing and implementing sequence clues after binary tree" what to do,

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 (Note Root)
{
//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).
}
  • Related