【单选题】【消耗次数:1】
在一个链队中,假设f和r分别为队头和队尾指针,p指向一个已生成的结点,现要为该结点的数据域赋值e,并使结点入队的运算为p-data=e; p-next=NULL ; 和( )。
A . f-next=p; f=p;
B. r-next=p;r=p;
C. p-next=r;r=p;
D. p-next=f;f=p;
参考答案:
复制
纠错
相关题目
【单选题】 假定一个链表的表头指针为f,结点结构为(data,next),则向该链表的表头插入一个由p所指向的结点时,应执行的操作为p-next=f和( )。
①  p=f-next
②  f=p-next
③  f=p
④  f-next=p
【单选题】 假定一个链表的表头指针为f,结点结构为(data,next),则向该链表的表头插入一个由p所指向的结点时,应执行的操作为p->next=f和( )。
①  p=f->next
②  f=p->next
③  f=p
④  f->next=p
【判断题】 设有一个带头结点的链队列,队列中每个结点由一个数据域data和指针域next组成,front和rear分别为链队列的头指针和尾指针。设p指向要入队的新结点(该结点已被赋值),则入队操作为rear-next=p; p = rear;
①  正确
②  错误
【判断题】 设有一个带头结点的,头指针为head的单向链表,p指向表中某一个结点,且有p-next= L,现要删除头结点,并使该单向链表构造成单向循环链表,通过操作head=head- p-next= head;。
①  正确
②  错误
【单选题】 若有以下定义:structnode{intdata;structnode*next;}structnode*p;已建立如下图所示的链表:┌──┬──┐┌──┬──┐┌──┬──┐p→│data│next┼→│data│next┼→...→│data│NULL│└──┴──┘└──┴──┘└──┴──┘指针p指向第一个结点,能输出链表所有结点的数据成员data的循环语句是()。
①  while(p!=NULL){printf("%d,",p-p++;}
②  while(p){printf("%d,",p.data);p=p-}
③  for(;p!=NULL;p++)printf("%d,",p
④  -for(;p;p=p-next)printf("%d,",(*p).data);
【判断题】 在双向链表中,要删除p所指的结点,其中所用的一条语句(p-prior)-next=p-next;的功能是:使P所指结点的直接前驱的右指针指向P所指结点的直接后继。
①  正确
②  错误
【判断题】 在一个链队中,假设f和r分别为队头和队尾指针,则删除一个结点的运算为f=f-。
①  正确
②  错误
【单选题】 在一个不带头结点的链队中,假设f和r分别为队头和队尾指针,则对该队列进行出队操作中并把结点的值保存在变量e中,其运算为e=f?data;和( )。
①  A.r=r?next;
②  B.r?next=r;
③  C.f=f?next;
④  D.f?next=f;
【判断题】 设有一个带头结点的链队列,队列中每个结点由一个数据域data和指针域next组成,front和rear分别为链队列的头指针和尾指针,要执行出队操作,用x保存出队元素的值,p为指向结点类型的指针,可执行如下操作:p=front-x=p- 然后执行front=p-。
①  正确
②  错误
【单选题】 在一个链队中,设front和rear分别为队首和队尾指针,则插入p所指结点时,应执行( )。
①  A.front-next=p;front=p;
②  B.rear-next=p;rear=p;
③  C.p-next=rear;rear=p;
④  D.p-next=front;front=p;
随机题目
【单选题】 I will give this dictionary to ____ wants to have it.
①  whomever
②  someone
③  whoever
④  anyone
【单选题】 The mountain is ____ 6.3 kilometers high, but it is not the highest one.
①  nearly
②  near
③  neat
④  neatly
【单选题】 A new teacher was sent to the village in place of ____ one who had retired.
①  a
②  the
③  an
④  Its
【单选题】 ____ was evident that Mr. Wang had come back to Shanghai.
①  This
②  He
③  That
④  It
【单选题】 Jack, the boss, asked Steven to leave — ____, she was filed.?
①  whats more ?
②  in addition?
③  on the contrary ?
④  D. in other words ?
【单选题】 He’s never again written ____ as his first one.
①  so good a book
②  such good a book
③  such good book
④  so a good book
【单选题】 “Where do you suggest going?” “We promised ____ the children to the West Lake.”
①  taking
②  to take
③  taken
④  took
【单选题】 Don’t be too ____ about things you are not supposed to know. ?
①  strange ?
②  amusing ?
③  curious ?
④  conscious?
【单选题】 To their surprise, they had much ____ and they even went to the same college. ?
①  in the same ?
②  in common ?
③  all the same ?
④  common things ?
【单选题】 ____ little earlier this morning! I missed the school bus by only a minute and had to wait in the cold for nearly an hour!
①  If I had got up
②  If only I get up
③  If only I had got up
④  If I got up