# FUNCTION

# Public

# TREE-DEPTH (TREE)

PRE: tree is a cons of the node and the list of children.
RETURN: the depth of the tree.

# TREE-GENERATE-RANDOM (DEPTH WIDTH)

RETURN: A random tree with random number as node, of maximal depth `depth'
and where each node has a maximum of `width` children.
NOTE: The result can easily be degenreate (a single node,
or a much smaller tree).

# TREE-SIZE (TREE)

PRE: tree is a cons of the node and the list of children.
RETURN: The size of the tree (number of nodes)

# TREE-TO-DIAGRAM (TREE)

PRE: tree is a cons of the node and the list of children.
DOES: writes to the *standard-output* the Diagram file text.

# Private

# TREE-DIAGRAM-GENERATE-ADJUST-X (INC)

PRIVATE.
inc: a list (n l x y) corresponding to the after last brother.
RETURN: a list (n' l' x' y') for the next uncle node.

# TREE-DIAGRAM-GENERATE-INHERIT (N L X Y)

PRIVATE.
DOES: Generates the Diagram text for a 'inherit' symbol (vertical triangle).
n: the Diagram symbol number (may be used in Diagram links).
l: the Diagram layer.
x,y: the coordinates.
RETURN: a list (n' l' x' y') for the first child node.

# TREE-DIAGRAM-GENERATE-NODE (N L X Y NODE)

PRIVATE.
DOES: Generates the Diagram text for a node.
n: the Diagram symbol number (may be used in Diagram links).
l: the Diagram layer.
x,y: the coordinates.
node: the text in the node rectangle.
RETURN: a list (n' l' x' y') for the following brother node.

# TREE-DIAGRAM-GENERATE-TREE (N L X Y TREE)

PRIVATE.
DOES: writes to the *standard-output* the Diagram text
for the subtree 'tree'.
RETURN: a list (n' l' x' y') for the next brother subtree.