tree insert( key, t )
typekey key[];
tree t;
{
int i, indx, noteq;
if ( t==NULL ) t = NewNode( key );
else { indx = noteq = 0;
for (i=0; i t->k[i] ) indx++;
if ( key[i] != t->k[i] ) noteq++;
}
if ( noteq ) t->p[indx] = insert( key, t->p[indx] );
else Error; /*** Key already in table ***/
}
return( t );
};
|