Exercises for Chapter #12 of A Common-Sense Guide To Data Structures and Algorithms
Get The Book!Write a function that counts the number of items in a binary tree.
Write a function that returns the sum of all the keys in a binary tree.
Write a function that returns the maximum value of all the keys in a binary tree. Assume all values are nonnegative; return nil if the tree is empty.
The height of a tree is the maximum number of nodes on a path from the root to a leaf node. Write a function that returns the height of a binary tree.