Documentation Project 1
ContentsIndexHome
PreviousUpNext
sack::containers::BinaryTree::AddBinaryNode Macro
C++
#define AddBinaryNode(r,u,k) AddBinaryNodeEx((r),(u),(k) DBG_SRC )
Parameters 
Description 
root 
PTREEROOT binary tree instance. 
data 
POINTER to some user object. 
key 
PTRSZVAL a integer type which can be used to identify the data. (used to compare in the tree).

If the user has specified a custom comparison routine in an extended CreateBinaryTree(), then this value might be a pointer to some other data. Often the thing used to key into a binary tree is a CTEXTSTR

The tree may be created with BT_OPT_NODUPLICATES, in which case this will result FALSE if the key is found duplicated in the list. Otherwise this returns TRUE. if the root parameter is NULL, the result is FALSE.

Adds a user pointer identified by key to a binary list.

   
PTREEROOT tree = CreateBinaryTree();
   
PTRSZVAL key = 1;
POINTER data = NewArray( TEXTCHAR, 32 );
   
AddBinaryNode( tree, data, key );
   
Copyright (c) 2010. All rights reserved.
What do you think about this topic? Send feedback!