Week 4: Trees Flashcards
What are some applications of a tree data structure?
Organzation of a company
What are the following groupings called corresponding to the following tree:
Root node, parent nodes, sibling nodes, children nodes
For the following tree, what nodes are:
Descendants of B
Descendants of A
Ancestors of J
Ancestors of A
What is an internal node? An external/leaf node?
What is the depth of a node? Height of a tree?
What are the following:
Depth of a tree
Height of a tree
Degree of a node
The degree of all nodes of a tree is equal to…
The number of edges
What is a subtree?
What is an odered tree?
Example of ordered trees:
What are unordered trees? Examples.
The number of nodes in a tree is equal to…
The number of edges + 1
The Tree ADT contains what methods?
What is the algorithm for computing the height of a tree?
Height of a tree algorithm with call stack: