Name: ________________________________
Honor Code Acknowledgment: ___________________
Ed Jones
What is the minimum height of a binary tree that contains 31 nodes? What
is the maximum height of a binary tree that contains 31 nodes?
Ed Gaedel
What is the minimum height of a binary tree that contains 1,023 nodes?
What is the maximum height of a binary tree that contains 1,023 nodes?
Bo Diddley Squat
Consider a tree in which each node contains a maximum of 4 children (a
quad tree). What is the minimum height of a quad tree that contains 21
nodes, what is the maximum height of a quad tree that contains 21 nodes?
What is the minimum height of a quad tree that contains
21,845 nodes?
Problem 1: Annie Trees (1 point)
True or False: In every non-empty binary tree there exists a node with
no parent. (justify your answer)
Problem 2 (4 points)
The height of a one-node tree is 0, the height of a non-empty
tree is the number of edges on the longest root-to-leaf
path (on a path,
the number of edges is always one less than the number of nodes.)
Bicep,Tricep
Problem 3: Search Me (2 points)
The function below is intended to return false if its parameter is NOT a
binary search tree
and true if it is a search tree. It does
not work as intended. Draw a tree that is not a search tree, but for
which the function returns true.