bct - binary cell tree module

Module Description

The bct module implements an unbalanced binary tree with the key and data

Module Words

cell based. The implementation is non-recursive.

Binary tree structure

bct% ( - n )
Get the required space for the bct structure

Tree creation, initialisation and destruction

bct-init ( w:data w:key w:bct - )
Initialise the bct structure with a key and data

bct-create ( C: "name" - R: - w:bct )
Create a named binary tree in the dictionary

bct-new ( - w:bct )
Create a new binary tree on the heap

bct-free ( w:bct - )
Free the tree node from the heap

Member words

bct-length@ ( w:bct - u )
Get the number of elements in the tree

bct-empty? ( w:bct - f )
Check for an empty tree

bct-compare@ ( w:bct - xt )
Get the compare execution token for comparing keys

bct-compare! ( xt w:bct - )
Set the compare execution token for comparing keys

Tree words

bct-insert ( w:data w:key w:bct - )
Insert data with a key in the tree

bct-delete ( w:key w:bct - false | w:data true )
Delete the key from the tree

bct-get ( w:key w:bct - false | w:data true )
Get the data from the tree

bct-has? ( w:key w:bct - f )
Check if the key is present in the tree

bct-execute ( ... xt w:bct - ... )
Execute xt for every key and data in the tree

Inspection

bct-dump ( w:bct - )
Dump the tree node structure


generated 09-Jan-2007 by ofcfrth-0.2.0