3.1 Trees Flashcards
What is a tree/graph
It is a non-linear data structure that organizes data in a hierarchical manner.
If a tree has n nodes, how many links will it have?
n-1 links
What is the root or root node?
This is the first element in a tree.
What is an edge?
This is a link that connects two nodes together.
What is a parent?
This is a node that is predecessor to other nodes or a node.
What is a child?
This is a node that is descendant to another node.
What are siblings?
These are nodes that share a parent.
What is a leaf node and what is another name for it?
It is a node without a child node, also known as an external node.
What is an internal node?
This is a node with at least one child.
What is the degree of a node?
This is the total number of children for a node.
What is the level of a node?
The root node is at level zero, its immediate children are at level 1, their immediate children are at level 2, and so on.
What is Height?
The total number of edges from a leaf node to another node is the height of that node.
What is the Height of a tree?
The height of the root node.
What is Depth?
The total number of edges from the root node to a specific node is the depth of that node.
What is path?
It is the sequence of edges and nodes from one node to another.
What is a subtree?
Each child from a node forms a subtree.
What are some types of trees?
- Tree, 2. Binary tree, 3. Complete Binary tree, 4. Strictly Binary tree.