【单选题】【消耗次数:1】
在一个尾指针为rear的不带头结点的单循环链表中,插入一个s所指的结点,并作为第一个结点,可执行( )。
A.rear?next= s; s?next=rear?next
B.rear?next=s?next;
C.rear=s?next
D.s?next=rear?next ; rear?next=s;
参考答案:
复制
纠错
相关题目
【单选题】 在一个尾指针为rear的不带头结点的单循环链表中,插入一个s所指的结点,并作为第一个结点,可执行( ).
①  A.rear?next=s;s?next=rear?next
②  B.rear?next=s?next;
③  C.rear=s?next
④  D.s?next=rear?next ; rear?next=s;
【判断题】 设有一个带头结点的链队列,队列中每个结点由一个数据域data和指针域next组成,front和rear分别为链队列的头指针和尾指针。设p指向要入队的新结点(该结点已被赋值),则入队操作为rear-next=p; p = rear;
①  正确
②  错误
【单选题】 在一个链队列中,front和rear分别为头指针和尾指针,则插入一个结点s的操作为( )。
①  front=front->next
②  s->next=rear;rear=s
③  rear->next=s;rear=s;
④  s->next=front;front=s;
【单选题】 假定一个链表的表头指针为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为指针域,且top是栈顶指针。若想在链栈的栈顶插入一个由指针s所指的结点,则应执行下列( )操作。
①  s-next=top-next;top-next=s
②  top-next=s
③  s-next=top;top=top-next
④  s-next=top;top=s;
【单选题】 若有以下定义: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);
【单选题】 在一个链队中,设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;
【单选题】 在一个链队列中,假定front和rear分别为队首和队尾指针,则删除一个结点的操作为( )。
①  front=front->next
②  rear=rear->next
③  rear=front->next
④  front=rear->next
【单选题】 已知串S=’aaab’,则next数组值为( )。
①  0123
②  1123
③  1231
④  1211
随机题目
【单选题】 Once our chickens started laying eggs, we had such a ____ of eggs that we were giving many away to our neighbors.
①  output
②  surplus
③  production
④  plenty
【单选题】 Most importantly, such an experience helps ____ a heightened sensitivity to other cultures and will bring about a greater appreciation of one’s own culture as well.
①  coach
②  forsake
③  foster
④  censor
【单选题】 She didn’ t come to the party last Sunday._____, she must have made the party more exciting.
①  If she came
②  Would she come
③  Had she come Did she come
【单选题】 Some companies have introduced flexible working time with less emphasis on pressure ____.
①  than more on efficiency
②  and more on efficiency
③  and more efficiency
④  than efficiency
【单选题】 Tom ____ his new job with confidence.
①  set out
②  set off
③  set up
④  set about
【单选题】 In some cases, your instructor may tell you the topics ____ or may give you a choice of topics to write about.
①  in advance
②  ahead of
③  above al
④  right away
【单选题】 Nancy was surprised that they have ____. They seemed to be a happy couple.
①  split up
②  broken down
③  fallen through
④  knocked out
【单选题】 — Whichsongdoyoulikebetter,Lucy?— IpreferthesongLittleApple ______ canattractmanypeople.
①  which
②  who
③  whom
④  where
【单选题】 Once ____, this power station will supply all the neighboring towns and villages with electricity.
①  it being completed
②  it completed
③  completed
④  it completes
【单选题】 The Brownings have not ____ yet and I doubt whether they will come.
①  turned in
②  turned out
③  turned up
④  turned to