An in-order traversal of the expression tree for (a - b) * c would result in which sequence?
a - b * c
A collection of disconnected trees is called a:
Forest
The degree of a tree is defined by:
The maximum degree of any vertex in the tree.
A tournament bracket… is a perfect real-world example of what kind of tree?
A full binary tree
Which tree theorem is most critical for understanding the maximum performance of database search operations?
The theorem relating the height to the number of nodes (h is at least lg(n+1) - 1).
The Java constructor public BTNode(T el) calls this(el, null, null);. What is the purpose of this line?
To call the other constructor, reusing its logic to set children to null.
Which of the following is the biggest drawback of using K-ary Tree Representation 1 (“One pointer per potential child”)?
Poor space efficiency for non-uniform trees.
In the breadthFirst algorithm, what is the purpose of the line p = dequeue()?
To get the next node to visit from the front of the queue.
An Abstract Data Type (ADT) is composed of:
Data and Operations
What does the getParent(n) operation return?
The direct parent node of n.
What is a “subtree”?
Any node in a tree and all of its descendants.
The term “ordered binary tree” implies that:
The positions of the left and right children are distinct and meaningful.
If you call setRight(n, el) on a node n that already has a right child, what is the outcome?
The existing right child and its entire subtree are replaced by the new node.
Fill in the Blank: The toString(T) operation typically starts by calling toString(n) on the root.
root
Fill in the Blank: The time complexity of a Breadth-First traversal is O(n).
O(n)
Fill in the Blank: The base case for the recursive depth-first traversals checks if the current node is null.
null
In an array representation of an almost complete binary tree, the parent of a node at index k is at index: (for 1-based indexing).
l k/2 l
The breadthFirst algorithm is:
iterative.
The acronym for Inorder traversal is:
LVR
To create a syntax tree, the algorithm first converts the infix expression to:
postfix
Two nodes that have the same parent are called:
siblings
A subtree consists of a node and all of its:
descendants
The operation isEmpty(T) returns true if T.root is:
null
The “first-child, next-sibling” representation is an example of a:
linked list