Chapter 4
What is the height of a BST built by inserting nodes in the order 20, 10, 30?
1
What is the height of a BST built by inserting nodes in the order 12, 24, 23, 48, 47?
3
Assume a full BST of height 8, how many nodes are in the tree?
511
Which of the following rules does a valid BST follow? Left subtree keys ≥ node's keys Left subtree keys ≤ node's keys Right subtree keys ≤ node's keys Right subtree keys ≤ left subtree keys
Left subtree keys ≤ node's keys
What happens when a leaf node is removed?
The parent's left or right child node becomes null
When is a new node inserted as the left child?
When the new node's key is less than the current node and the current node's left child is null
Name a type of binary tree which has the maximum number of nodes on every level except the last, and on this last level, the nodes occur exactly from left to right.
complete
A _______________ traversal would be used if you needed to save the contents of a BST on file with the same shape. This type of traversal would also be used if you wanted to make an exact copy of a BST.
pre-order