程序填空题:BinQ_DeleteRt
The function `DeleteRt` is to delete the root of a subtree with index `Pos` from a binomial queue `H`. The rest of the subtree is then stored as a new binomial queue and returned.
```c++
BinQ DeleteRt( BinQ H, int Pos )
{
BinTree OldRoot, SubTree;
BinQ NewBinQ;
int p;
OldRoot = H->TheTrees[Pos];
SubTree = OldRoot->LeftChild;
free(OldRoot);
NewBinQ = Initialize();
NewBinQ->CurrentSize = @@[(1< for ( @@[p=Pos-1; p>=0; p--](3) ) {
NewBinQ->TheTrees[p] = SubTree;
SubTree = SubTree->NextSibling;
NewBinQ->TheTrees[p]->NextSibling = NULL;
}
return NewBinQ;
}
```
答案:
第1空:(1<
第2空:p=Pos-1; p>=0; p--
```c++
BinQ DeleteRt( BinQ H, int Pos )
{
BinTree OldRoot, SubTree;
BinQ NewBinQ;
int p;
OldRoot = H->TheTrees[Pos];
SubTree = OldRoot->LeftChild;
free(OldRoot);
NewBinQ = Initialize();
NewBinQ->CurrentSize = @@[(1<
NewBinQ->TheTrees[p] = SubTree;
SubTree = SubTree->NextSibling;
NewBinQ->TheTrees[p]->NextSibling = NULL;
}
return NewBinQ;
}
```
答案:
第1空:(1<
第2空:p=Pos-1; p>=0; p--