void BSTinsertR(Item item)
{//重复的键的插入操作
if (header == NULL)
{
header = NEW(item,NULL, NULL, 1);
return;
}
if (header == z)
{
header = NEW(item, z, z, 1);
return;
}
Key t = key(item);
PBSTNode p = header,x = p;
while (x != z)
{
p = x;
x->N++;
if(t < key(p->data))
{
x = x->left;
if (x == z)
{
p->left = NEW(item,z, z, 1);
}
}
else
{
x = x->right;
if (x == z)
{
p->right = NEW(item,z, z, 1);
}
}
}
}