INDEX CLUSTER FEATURES SHORT FRAMES NO FRAMES

indexing

description: "Trees implemented using a linked list representation"
title: "EiffelBase: library of reusable components for Eiffel. ", "Based on EiffelBase library for ISE Eiffel, ", "used with permission. "
project: "EiffelBase Library"
copyright: "(c) 1986-1997 Interactive Software Engineering Inc. ", "Modifications and extensions: ", "(c) 1997 Object Tools ", "All rights reserved. Duplication and distribution prohibited", "May be used only with Visual Eiffel under terms of user ", "license "
key: linked_tree, tree, linked_list
cluster: eiffelbase
class LINKED_TREE [G]
inherit

DYNAMIC_TREE [G]
undefine
child_after,
child_before,
child_item,
child_off
redefine
parent
select
has
end

LINKABLE [G]
rename
right as right_sibling,
put_right as l_put_right
export
{ANY}
put,
replace
{LINKED_TREE}
forget_right,
l_put_right
end

LINKED_LIST [G]
rename
active as child,
put_left as child_put_left,
put_right as child_put_right,
after as child_after,
back as child_back,
before as child_before,
count as arity,
cursor as child_cursor,
duplicate as ll_duplicate,
empty as is_leaf,
extend as child_extend,
extendible as child_extendible,
fill as ll_fill,
finish as child_finish,
first_element as first_child,
forth as child_forth,
full as ll_full,
go_i_th as child_go_i_th,
go_to as child_go_to,
has as ll_has,
index as child_index,
isfirst as child_isfirst,
islast as child_islast,
item as child_item,
last_element as last_child,
make as ll_make,
merge_left as ll_merge_left,
merge_right as ll_merge_right,
off as child_off,
prune as ll_prune,
put as child_put,
readable as child_readable,
remove as remove_child,
remove_left as remove_left_child,
remove_right as remove_right_child,
replace as child_replace,
search as search_child,
start as child_start,
writable as child_writable
export
{ANY}
child
{NONE}
ll_duplicate,
ll_fill,
ll_full,
ll_has,
ll_make,
ll_merge_left,
ll_merge_right
undefine
child_isfirst,
child_islast,
child_readable,
child_writable,
is_leaf,
linear_representation,
valid_cursor_index
redefine
first_child,
new_cell
select
is_leaf
end
creation

make
feature -- Initialization

make (v: G)
-- Create single node with item `v'.
ensure
is_root
is_leaf
feature -- Access

parent: like Current

first_child: like parent

left_sibling: like parent
-- Left neighbor (if any)
feature -- Element change

put_child (n: like parent)
-- Add `n' to the list of children.
-- Do not move child cursor.

replace_child (n: like parent)
-- Replace current child by `n'.

put_child_left (n: like parent)
-- Add `n' to the left of cursor position.
-- Do not move cursor.

put_child_right (n: like parent)
-- Add `n' to the right of cursor position.
-- Do not move cursor.

merge_tree_before (other: like parent)
-- Merge children of `other' into current structure
-- before cursor position. Do not move cursor.
-- Make `other' a leaf.

merge_tree_after (other: like parent)
-- Merge children of `other' into current structure
-- after cursor position. Do not move cursor.
-- Make `other' a leaf.

prune (n: like parent)
invariant

no_void_child: readable_child = child_readable
end -- class LINKED_TREE

INDEX CLUSTER FEATURES SHORT FRAMES NO FRAMES