【单选题】【消耗次数:1】
从一个栈顶指针为top的链栈中删除一个结点时,用x保存被删除的结点,应执行下列( )命令。
x=top;top=top-next
top=top-x=top-data
x=top-data
x=top-top=top-
参考答案:
复制
纠错
相关题目
【判断题】 从一个栈顶指针为top的链栈中删除一个结点时,用变量x保存被删结点的值,则执行x=top- top=top-。
①  正确
②  错误
【判断题】 从一个栈顶指针为top的链栈中删除一个结点时,用d保存被删结点的值,可执行d=top-top=top-。(结点的指针域为next,数据域为data)
①  正确
②  错误
【判断题】 设top是一个链栈的栈顶指针,栈中每个结点由一个数据域data和指针域next组成,设用x接收栈顶元素,则出栈操作为top=top-x=top-。
①  正确
②  错误
【单选题】 在一个栈顶指针为top的链栈中删除一个结点时,用 x保存被删结点的值,则执行( )。
①  A.x=top;top=top
②  -B.x=top
③  -C.top=top-x=top
④  -D.x=top- top=top-
【单选题】 从一个栈顶指针为top的链栈中取栈顶元素,用变量x保存该元素的值,则执行( )。
①  A.x=top- top=top?next;
②  B.x=top
③  -C.top=top- x=top-
④  D.top=top- x=data;
【单选题】 在一个栈顶指针为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的链栈进行出栈操作,用变量e保存栈顶元素的值 ,则执行( )。
①  A. e= top- top-data=e;
②  B.e=top- top=top
③  -C.top=top- e=top
④  -D.top=top- e=data;
【单选题】 设链栈中结点的结构: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;
【单选题】 在一个具有n个单元的顺序栈中,假定以地址低端(即0单元)作为栈底,以top作为栈顶指针,当做出栈处理时,top变化为( )。
①  top不变
②  top=0
③  top-
④  -top++
【单选题】 一个顺序栈S,其栈顶指针为top,则将元素e入栈的操作是( )。
①  *S->top=e;S->top++;
②  S->top++;*S->top=e;
③  *S->top=e
④  S->top=e;
随机题目
【单选题】 He was[填空] three-year-old baby at that time.
①  a
②  an
③  the
④  /
【单选题】 He used to be [填空] worker but later he turned [填空] drawer.
①  a,a
②  a,the
③  /,a
④  a,/
【判断题】 A: I have won the race. B: Wonderful.
①  正确
②  错误
【判断题】 A: Wonderful weather! B: Yes, isnt it.
①  正确
②  错误
【判断题】 A: You know, I have three kids now. B: Thats terrific.
①  正确
②  错误
【判断题】 A: Would you mind if I turned the radio up? B: No, go ahead.
①  正确
②  错误
【判断题】 A: What is your boyfriend like? B: He is tall and handsome.
①  正确
②  错误
【判断题】 A: Its fine today, and I dont love to stay indoors. B: I dont like it, too.
①  正确
②  错误
【判断题】 A: Could you mail the letter for me? B: Yes, I could.
①  正确
②  错误
【判断题】 A: Could I borrow your CD of English songs? B: Im sorry. Its not at hand now.
①  正确
②  错误