A tree where a vertex is designated as the root vertex.
Height
Length of the longest path from the root.
Level
For a given vertex , length of the simple path from the root to .
Parent
For a given vertex , its parent vertex is the unique vertex where and there is an edge between and .
Child
For a given vertex , is a child of iff is the parent of .
Siblings
Vertices with the same parent.
Ancestors
For a given vertex , all vertices in the path from the root to , excluding and including the root.
Descendants
For a given vertex , all vertices that have as their ancestor.
Leaf
In a rooted tree, a leaf does not have any children.
Internal vertices
Vertices that have children.
Sub-rooted tree
Suppose is a vertex in a tree. Then the sub-tree with as its root is the sub-graph of the tree consisting of and its descendants and all edges incident to these descendants.
Decision tree
Vertices represent the decision points or events, where a decision could be made. Edges represent the possible decisions/outcomes of different choices.
Representation of Algebraic Expressions
There are 3 common forms of algebraic expressions.
Infix form
The symbol is written in-between the operands. The form we usually use.
Example:
Prefix form
Aka. Polish form. The symbol is written before the operands.
’s prefix form is:
Parantheses are not required.
Postfix form
Aka. reverse Polish form. The symbol is written after the operands. Used commonly when parsing algebraic expressions in calculators.
’s prefix form is: