【单选题】【消耗次数: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-
随机题目
【简答题】 用真值表判断公式“((p?q) ù (q?r)) ? (p?r)”的类型:[填空1]
【简答题】 公式“? (p?q)”的主析取范式为:[填空1]
【简答题】 下面哪个是集合 A={2, 3, 4}上的恒等关系:[填空1]
【简答题】 设 A = {1, 2=,2, 4=,3, 3=},B = {1, 3=,2, 4=,4, 2=},则交关系A∩B等于:[填空1]
【简答题】 设 p: 2+3=5. q: 大熊猫产在中国. r: 复旦大学在广州. 则复合命题公式“(r? (pùq)) ? ?p”的真值为:[填空1]
【简答题】 Translate the following sentence into English.相对于在百货商店购物我更喜欢在网上购物,因为它更加方便和省时。
【简答题】 Translate the following sentence into English.你讲什么内容并不重要,重要的是你必须要演讲。
【简答题】 Direction: Fill in the blanks with the words given below. Change the form if necessary.[vain; frame; curve; twist; comb; collapse; scatter; scratch; rebuild; harsh]5. The horses liked this grooming, and I think, if they could talk, they would tell you where to[填空1]or comb.
【简答题】 Direction: Fill in the blanks with the words given below. Change the form if necessary.[expand; abuse; knowledge; narrative; plantation; property; oppressive; extremely; rebel; abolitionist]6. If someone takes away your[填空1]in that country, you have no recourse.
【简答题】 Direction: Fill in the blanks with thephrases given below. Change the form if necessary.[ought to; look forward to; in wonder; give way to; look down; on the way to; reach out; put one’s arm around; trip over; cut into]1. My dear, do not[填空1]such gloomy thoughts. Let us hope for better things.