act - AVL binary tree cell module

Module Description

The act module implements an AVL binary tree with the key and data cell based. The act module is a specialisation of the bct module. As a result the bci iterator can be used as iterator for the act tree. The implementation is non-recursive.

Module Words

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

Tree creation, initialisation and destruction

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

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

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

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

Member words

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

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

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

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

Tree words

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

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

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

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

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

Inspection

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


generated 09-Jan-2007 by ofcfrth-0.2.0