tree insert( key, t )
typekey key;
tree t;
{
if( t==NULL ) t = NewNode( key, NULL, NULL );
else if( t->k == key )
Error; /*** key already in table ***/
else if( t->k < key ) t->right = insert( key, t->right );
else t->left = insert( key, t->left );
return( t );
}
|