btree NewNode( k1, p0, p1 )
typekey k1;
btree p0, p1;
{btree tempr;
tempr = (btree)malloc( sizeof( node ) );
tempr->p[0] = p0;
tempr->p[1] = p1;
tempr->k[0] = k1;
tempr->d = 1;
return( tempr );
}
InsInNode( t, key, ptr )
btree t, ptr;
typekey key;
{int j;
for( j=t->d; j>0 && keyk[j-1]; j-- ) {
t->k[j] = t->k[j-1];
t->p[j+1] = t->p[j];
}
t->d++;
t->k[j] = key;
t->p[j+1] = ptr;
}
|