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
*)
VAR
parent, node: Node; (* not used *)
BEGIN
RETURN tree.comparable(object) &
~Find(tree, object, parent, node)
END Acceptable;
PROCEDURE Comparable(tree: Tree;
key: Objects.Object) : BOOLEAN;
(* returns TRUE if key can be compared to
objects of tree
*)
BEGIN
RETURN tree.comparable(key)
END Comparable;
|