Module splay-tree Methods
AddValueToSplayTree
AddValueToSplayTree() adds a value to the splay-tree.
The format of the AddValueToSplayTree method is:
WizardBooleanType AddValueToSplayTree(SplayTreeInfo *splay_tree,
const void *key,const void *value)
A description of each parameter follows:
splay_tree
The splay-tree info.
key
The key.
value
The value.
BalanceSplayTree
BalanceSplayTree() balances the splay-tree.
The format of the BalanceSplayTree method is:
void *BalanceSplayTree(SplayTreeInfo *splay_tree,const void *key)
A description of each parameter follows:
splay_tree
The splay-tree info.
key
The key.
CloneSplayTree
CloneSplayTree() clones the splay tree.
The format of the CloneSplayTree method is:
SplayTreeInfo *CloneSplayTree(SplayTreeInfo *splay_tree,
void *(*clone_key)(void *),void *(*cline_value)(void *))
A description of each parameter follows:
splay_tree
The splay tree.
clone_key
The key clone method, typically ConstantString(), called whenever a key is added to the splay-tree.
clone_value
The value clone method; typically ConstantString(), called whenever a value object is added to the splay-tree.
CompareSplayTreeString
CompareSplayTreeString() method finds a node in a splay-tree based on the contents of a string.
The format of the CompareSplayTreeString method is:
int CompareSplayTreeString(const void *target,const void *source)
A description of each parameter follows:
target
The target string.
source
The source string.
CompareSplayTreeStringInfo
CompareSplayTreeStringInfo() finds a node in a splay-tree based on the contents of a string.
The format of the CompareSplayTreeStringInfo method is:
int CompareSplayTreeStringInfo(const void *target,const void *source)
A description of each parameter follows:
target
The target string.
source
The source string.
DeleteNodeByValueFromSplayTree
DeleteNodeByValueFromSplayTree() deletes a node by value from the splay-tree.
The format of the DeleteNodeByValueFromSplayTree method is:
WizardBooleanType DeleteNodeByValueFromSplayTree(
SplayTreeInfo *splay_tree,const void *value)
A description of each parameter follows:
splay_tree
The splay-tree info.
value
The value.
DeleteNodeFromSplayTree
DeleteNodeFromSplayTree() deletes a node from the splay-tree.
The format of the DeleteNodeFromSplayTree method is:
WizardBooleanType DeleteNodeFromSplayTree(SplayTreeInfo *splay_tree,
const void *key)
A description of each parameter follows:
splay_tree
The splay-tree info.
key
The key.
DestroySplayTree
DestroySplayTree() destroys the splay-tree.
The format of the DestroySplayTree method is:
SplayTreeInfo *DestroySplayTree(SplayTreeInfo *splay_tree)
A description of each parameter follows:
splay_tree
The splay tree.
GetNextKeyInSplayTree
GetNextKeyInSplayTree() gets the next key in the splay-tree.
The format of the GetNextKeyInSplayTree method is:
const void *GetNextKeyInSplayTree(SplayTreeInfo *splay_tree)
A description of each parameter follows:
splay_tree
The splay tree.
key
The key.
GetNextValueInSplayTree
GetNextValueInSplayTree() gets the next value in the splay-tree.
The format of the GetNextValueInSplayTree method is:
const void *GetNextValueInSplayTree(SplayTreeInfo *splay_tree)
A description of each parameter follows:
splay_tree
The splay tree.
key
The key.
GetValueFromSplayTree
GetValueFromSplayTree() gets a value from the splay-tree by its key.
The format of the GetValueFromSplayTree method is:
const void *GetValueFromSplayTree(SplayTreeInfo *splay_tree,
const void *key)
A description of each parameter follows:
splay_tree
The splay tree.
key
The key.
GetNumberOfNodesInSplayTree
GetNumberOfNodesInSplayTree() returns the number of nodes in the splay-tree.
The format of the GetNumberOfNodesInSplayTree method is:
size_t GetNumberOfNodesInSplayTree(
const SplayTreeInfo *splay_tree)
A description of each parameter follows:
splay_tree
The splay tree.
IterateOverSplayTree
IterateOverSplayTree() iterates over the splay-tree.
The format of the IterateOverSplayTree method is:
int IterateOverSplayTree(SplayTreeInfo *splay_tree,
int (*method)(NodeInfo *,void *),const void *value)
A description of each parameter follows:
splay_tree
The splay-tree info.
method
The method.
value
The value.
NewSplayTree
NewSplayTree() returns a pointer to a SplayTreeInfo structure initialized to default values.
The format of the NewSplayTree method is:
SplayTreeInfo *NewSplayTree(int (*compare)(const void *,const void *),
void *(*relinquish_key)(void *),void *(*relinquish_value)(void *))
A description of each parameter follows:
compare
The compare method.
relinquish_key
The key deallocation method, typically RelinquishWizardMemory(), called whenever a key is removed from the splay-tree.
relinquish_value
The value deallocation method; typically RelinquishWizardMemory(), called whenever a value object is removed from the splay-tree.
RemoveNodeByValueFromSplayTree
RemoveNodeByValueFromSplayTree() removes a node by value from the splay-tree and returns its key.
The format of the RemoveNodeByValueFromSplayTree method is:
void *RemoveNodeByValueFromSplayTree(SplayTreeInfo *splay_tree,
const void *value)
A description of each parameter follows:
splay_tree
The splay-tree info.
value
The value.
RemoveNodeFromSplayTree
RemoveNodeFromSplayTree() removes a node from the splay-tree and returns its value.
The format of the RemoveNodeFromSplayTree method is:
void *RemoveNodeFromSplayTree(SplayTreeInfo *splay_tree,const void *key)
A description of each parameter follows:
splay_tree
The splay-tree info.
key
The key.
ResetSplayTree
ResetSplayTree() resets the splay-tree. That is, it deletes all the nodes from the tree.
The format of the ResetSplayTree method is:
ResetSplayTree(SplayTreeInfo *splay_tree)
A description of each parameter follows:
splay_tree
the splay tree.
ResetSplayTreeIterator
ResetSplayTreeIterator() resets the splay-tree iterator. Use it in conjunction with GetNextValueInSplayTree() to iterate over all the nodes in the splay-tree.
The format of the ResetSplayTreeIterator method is:
ResetSplayTreeIterator(SplayTreeInfo *splay_tree)
A description of each parameter follows:
splay_tree
The splay tree.
SplaySplayTree
SplaySplayTree() splays the splay-tree.
The format of the SplaySplayTree method is:
void SplaySplayTree(SplayTreeInfo *splay_tree,const void *key,
NodeInfo **node,NodeInfo **parent,NodeInfo **grandparent)
A description of each parameter follows:
splay_tree
The splay-tree info.
key
The key.
node
The node.
parent
The parent node.
grandparent
The grandparent node.

![[sponsor]](../../images/networkredux.png)