Guided Practice 5.1: A Different Kind of Tree
Consider a data structure of trees that have leaves with numbers in them, and two kinds of interior nodes: one kind with two sons and the other kind with three sons. Here's an example:
These trees are similar, but not identical to what are usually called 2-3 trees.
- Write a data definition for these trees.
- Write leaf-max for these trees.
- Write a function double-all that takes one of these trees and returns a tree of the same shape in which all the leaves are doubled. For example, double-all applied to the tree above should return the tree
Last modified: Wed Aug 9 21:59:20 Eastern Daylight Time 2017