5.3 Trees Flashcards
1
Q
What is a parent node?
A
A node in a tree that has children.
2
Q
What is a child node?
A
A node below a parent node.
3
Q
What is a subtree?
A
A parent with children within another parent child relationship.
4
Q
What is a root?
A
Top of the tree
5
Q
What is a leaf?
A
A node with no children.
6
Q
How do you traverse preorder?
A
Put flag on left, traverse from left to right collection flags.
7
Q
How do you traverse inorder?
A
Flag below the node, and collect the flags left to right.
8
Q
How do you post order traversal?
A
Flag on the right of the node. Collect flags left to right.
9
Q
What is breadth order tree traversal?
A
Left to right layer by later
starting from root.