DEFINITION BinTree; (* generic binary trees *) (* by h. M”ssenb”ck *) (* extended by Dirk_Theisen@su.maus.de *) CONST (* traverse modes *) inorder = 0; preorder = 1; postorder = 2; TYPE Node = POINTER TO NodeDesc; NodeDesc = RECORD PROCEDURE (x: Node) EqualTo(y: Node): BOOLEAN; (* please override *) PROCEDURE (x: Node) LessThan(y: Node): BOOLEAN;(* please override *) END; doproc = PROCEDURE (x: Node); Tree = RECORD PROCEDURE (t: Tree) Init(); PROCEDURE (t: Tree) Insert(x: Node); PROCEDURE (t: Tree) Search(x: Node): Node; PROCEDURE (t: Tree) Delete(x: Node); PROCEDURE (t: Tree) Traverse(mode: SHORTINT; do: doproc); END; END BinTree.