//insert a new element of the
Int InsertQueue (LinkQueue & amp; Q, QElemType e)
{
QueuePtr s=(QueuePtr) malloc (sizeof (QNode));
if (! S)
{
Cout & lt;
}
S - & gt; Data=https://bbs.csdn.net/topics/e;
S - & gt; Next=NULL;
Q.r ear - & gt; Next=s;
Q.r ear=s;
return OK;
}
CodePudding user response:
S - & gt; Next=NULL; Can be understood as initialization, s is a link to the end of the queue, the queue at the end of the next is not executed NULL?The original poster can have a look at the queue traversal by judging whether NULL to determine if, at the end of the
New nodes come in, will be put on a s - & gt; NULL to cover the next, is to use the new cover on a s - s & gt; next
CodePudding user response:
Next of nodes connected to a new domain, the new node of the next point to NULL,