在程序适当位置填入缺失内容:(请将序号及内容填写在答题卡上)
向单链表的末尾添加一个元素的算法。
void InserRear(LNode*& HL, const ElemType& item)
{
LNde* newptr;
newptr=new LNode;
if ( )
{
err<<”Memory allocation failare!”<<end1;
exit(1);
}
( )=item;
newptr->next=NULL
if (HL==NULL)
HL=( );
else {
LNode* p=HL;
While (P->next!=NULL)
( );
p->next=newptr;
}
}
