Automatic generation produced by ISE Eiffel

Classes Clusters Cluster hierarchy Chart Relations Text Flat Contracts Flat contracts Go to:
indexing description: "Binary tree: each node may have a left child and a right child" status: "See notice at end of class" names: binary_tree, tree, fixed_tree representation: recursive, array access: cursor, membership contents: generic date: "$Date: 2001-11-16 20:32:23 +0000 (Fri, 16 Nov 2001) $" revision: "$Revision: 51435 $" class interface BINARY_TREE [G] create make feature -- Initialization make (v: like item) -- Create a root node with value v. ensure is_root: is_root is_leaf: is_leaf feature -- Access parent: BINARY_TREE [G] -- Parent of current node child_index: INTEGER -- Index of cursor position left_child: like parent -- Left child, if any right_child: like parent -- Right child, if any left_item: like item -- Value of left child require has_left: left_child /= void right_item: like item -- Value of right child require has_right: right_child /= void first_child: like parent -- Left child last_child: like parent -- Right child child: like parent -- Child at cursor position child_cursor: CURSOR -- Current cursor position left_sibling: like parent -- Left neighbor, if any right_sibling: like parent -- Right neighbor, if any feature -- Measurement arity: INTEGER -- Number of children ensure then valid_arity: Result <= 2 feature -- Status report child_after: BOOLEAN -- Is there no valid child position to the right of cursor? is_leaf: BOOLEAN -- Are there no children? -- Was declared in BINARY_TREE as synonym of has_none. has_none: BOOLEAN -- Are there no children? -- Was declared in BINARY_TREE as synonym of is_leaf. has_left: BOOLEAN -- Has current node a left child? ensure Result = (left_child /= void) has_right: BOOLEAN -- Has current node a right child? ensure Result = (right_child /= void) has_both: BOOLEAN -- Has current node two children? ensure Result = (has_left and has_right) feature -- Cursor movement child_go_to (p: ARRAYED_LIST_CURSOR) -- Move cursor to child remembered by p. child_start -- Move to first child. child_finish -- Move cursor to last child. child_forth -- Move cursor to next child. child_back -- Move cursor to previous child. child_go_i_th (i: INTEGER) -- Move cursor to i-th child. feature -- Element change put_left_child (n: like parent) -- Set left_child to n. require no_parent: n = void or else n.is_root put_right_child (n: like parent) -- Set right_child to n. require no_parent: n = void or else n.is_root child_put (v: like item) -- Put v at current child position. -- Was declared in BINARY_TREE as synonym of child_replace. child_replace (v: like item) -- Put v at current child position. -- Was declared in BINARY_TREE as synonym of child_put. put_child (n: like parent) -- Put n at current child position. -- Was declared in BINARY_TREE as synonym of replace_child. replace_child (n: like parent) -- Put n at current child position. -- Was declared in BINARY_TREE as synonym of put_child. feature -- Removal remove_left_child -- Remove left child. ensure not has_left remove_right_child -- Remove right child. ensure not has_right child_remove -- Remove current child. prune (n: like parent) -- Prune n from child nodes. feature -- Duplication duplicate (n: INTEGER): like Current -- Copy of sub-tree beginning at cursor position and -- having min (n, arity - child_index + 1) -- children. duplicate_all: like Current copy (other: like Current) -- Copy contents from other. invariant tree_is_binary: child_capacity = 2 indexing library: "[ EiffelBase: Library of reusable components for Eiffel. ]" status: "[ Copyright 1986-2001 Interactive Software Engineering (ISE). For ISE customers the original versions are an ISE product covered by the ISE Eiffel license and support agreements. ]" license: "[ EiffelBase may now be used by anyone as FREE SOFTWARE to develop any product, public-domain or commercial, without payment to ISE, under the terms of the ISE Free Eiffel Library License (IFELL) at http://eiffel.com/products/base/license.html. ]" source: "[ Interactive Software Engineering Inc. ISE Building 360 Storke Road, Goleta, CA 93117 USA Telephone 805-685-1006, Fax 805-685-6869 Electronic mail <info@eiffel.com> Customer support http://support.eiffel.com ]" info: "[ For latest info see award-winning pages: http://eiffel.com ]" end -- class BINARY_TREE
Classes Clusters Cluster hierarchy Chart Relations Text Flat Contracts Flat contracts Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com