How to traverse a tree where
How to traverse a tree where the children are pointers to trees
The pseudocode for left - node - right (in order) traversal is:
To traverse from tree pointer using array A to gather the data with variable size (must be by reference) showing the current number of entries in A:
- If the left child tree pointer is not Null
- Traverse from the left child using array A and variable size
- Copy the data in this node into slot size in A and increment size.
- If the right child tree pointer is not NULL
- Traverse from the right child using array A and variable size.
File translated from TEX by TTH, version 2.25.
On 31 Oct 2002, 18:38.