TYPE
Tree = POINTER TO TreeRec;
TreeRec = RECORD (Objects.ObjectRec) END;
TYPE
VisitProc = PROCEDURE (object: Objects.Object);
(* called by Traverse for all objects of a tree *)
PROCEDURE Acceptable(tree: Tree;
object: Objects.Object) : BOOLEAN;
(* returns TRUE if object may be inserted into tree,
i.e. if it is comparable to other objects of that
tree and if there is no object yet in tree that
is identical to object
*)
PROCEDURE Comparable(tree: Tree;
key: Objects.Object) : BOOLEAN;
(* returns TRUE if key can be compared
to objects of tree
*)
PROCEDURE Insert(tree: Tree; object: Objects.Object);
(* precondition: object must be acceptable for tree;
inserts object into tree
*)
PROCEDURE Delete(tree: Tree; key: Objects.Object);
(* precondition: key must be comparable to
other objects of tree;
deletes object out of the tree that is identical
to key if present
*)
|