Binary Trees
Suppose T is a binary tree with 14 nodes. What is the minimum possible height of T?
3
What is the minimum number of internal nodes in a binary tree with 8 nodes?
4
What is the minimum number of nodes in a full binary tree with height 3?
7
What is the minimum number of nodes in a complete binary tree with height 3?
8
Why does function preorder2() presented in the Traversal module make only half as many recursive calls as function preorder()?
Because half of the pointers are null
Which statement is false? Every binary tree has at least one node Every non-empty binary tree has exactly one root node Every non-root node in a binary tree has exactly one parent Every node in a binary tree has exactly two children
Every binary tree has at least one node
A binary tree is another name for a BST.
False
If you are given the order of the nodes as visited by a preorder traversal and the order of the nodes as visited by a postorder traversal, do you have enough information to reconstruct the original tree? Assume that the nodes all have unique values.
False
Select the one true statement. Every binary tree is either complete or full Every complete binary tree is also a full binary tree Every full binary tree is also a complete binary tree No binary tree is both complete and full
None of the above
BST search, insert, and delete operations typically run in time O(d). What is d?
The depth of the relevant node in the tree
Visiting each element in a tree is known as:
Traversing
If you are given the order of the nodes as visited by a preorder traversal and the order of the nodes as visited by an inorder traversal, do you have enough information to reconstruct the original tree? Assume that the nodes all have unique values.
True
When you print out the nodes of binary tree, the leaf nodes appear in the same relative order for the preorder, inorder, and postorder traversals.
True
The n nodes in a binary tree can be visited in:
Θ(n) time