【单选题】【消耗次数:1】
设链栈中结点的结构: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;
参考答案:
复制
纠错
相关题目
【判断题】 设top是一个链栈的栈顶指针,栈中每个结点由一个数据域data和指针域next组成,设用x接收栈顶元素,则出栈操作为top=top-x=top-。
①  正确
②  错误
【判断题】 从一个栈顶指针为top的链栈中删除一个结点时,用d保存被删结点的值,可执行d=top-top=top-。(结点的指针域为next,数据域为data)
①  正确
②  错误
【单选题】 一个顺序栈S,其栈顶指针为top,则将元素e入栈的操作是( )。
①  *S->top=e;S->top++;
②  S->top++;*S->top=e;
③  *S->top=e
④  S->top=e;
【单选题】 在一个栈顶指针为top的链栈中,将一个p指针所指的结点入栈,应执行( )。
①  A.top-next=p;
②  B.p-next=top-top-next=p;
③  C.p-next=top; top=p;
④  D.p-next=top- top=top-
【判断题】 从一个栈顶指针为top的链栈中删除一个结点时,用变量x保存被删结点的值,则执行x=top- top=top-。
①  正确
②  错误
【单选题】 对一个栈顶指针为top的链栈进行进栈操作,设P为指向待进栈的结点的指针,把e的值赋值给该结点的数据域,然后使该结点进栈,则执行( )。
①  A.p-data=e; p=top- top=topànext;
②  B.p-data=e;p-next=top;top=p;
③  C.p-data=e;top=p;
④  D.p-data=e;p-next=top- top =p;
【单选题】 从一个栈顶指针为top的链栈中删除一个结点时,用x保存被删除的结点,应执行下列( )命令。
①  x=top;top=top-next
②  top=top-x=top-data
③  x=top-data
④  x=top-top=top-
【单选题】 对一个栈顶指针为top的链栈进行出栈操作,用变量e保存栈顶元素的值 ,则执行( )。
①  A. e= top- top-data=e;
②  B.e=top- top=top
③  -C.top=top- e=top
④  -D.top=top- e=data;
【单选题】 从一个栈顶指针为top的链栈中取栈顶元素,用变量x保存该元素的值,则执行( )。
①  A.x=top- top=top?next;
②  B.x=top
③  -C.top=top- x=top-
④  D.top=top- x=data;
【单选题】 在一个栈顶指针为top的链栈中删除一个结点时,用 x保存被删结点的值,则执行( )。
①  A.x=top;top=top
②  -B.x=top
③  -C.top=top-x=top
④  -D.x=top- top=top-
随机题目
【单选题】 Yourjobiseasy.Youhavenoreasonto__________.
①  complaint
②  complain
③  explain
④  plain
【单选题】 Thequestionis_______wewillhaveoursportsmeetnextweek.
①  that
②  if
③  when
④  whether
【单选题】 Thereasoniswhyhefailedis_______hewastoocareless.
①  because
②  that
③  for
④  becauseof
【单选题】 Itistheteacher_______teachesmehowtobearespectableman.
①  who
②  which
③  that
④  what
【单选题】 Youshouldkeeponyourdreams,andnever________
①  giveoff
②  giveup
③  givein
④  giveaway
【单选题】 _______thiskindofpeach,andyouwilllikeit.
①  Totry
②  Trying
③  Try
④  tried
【单选题】 Itwasthetraining_______hehadasayoungman_______madehimsuchagoodengineer.
①  what;that
②  that;what
③  that;which
④  which;that
【单选题】 Don’tsmokehere,oryouwillbefined.-----Yes,thereisasign:No_________.<br/>
①  Smoke
②  Smoking
③  tosmoke
④  A.???smoked
【单选题】 Thesummervacationis_______
①  atonce
②  athand
③  atleast
④  atlarge
【单选题】 He_____allthathadhappenedtohim.
①  hadtold
②  telldid
③  didtell
④  wouldtell