设顺序栈S的栈顶指针为top,则元素a入栈的操作是( )。
A: S->top++; *S->top = e;
B: *S->top->top = e; S-top++;
C: *S->top = e;
D: S->top = e;
A: S->top++; *S->top = e;
B: *S->top->top = e; S-top++;
C: *S->top = e;
D: S->top = e;
举一反三
- 一个顺序栈S,其栈顶指针为top,则将元素e入栈的操作就是( )。 A: *S->top=e B: *S->top=e;S->top++ C: S->top++;*S->top=e D: S->top=e
- 若栈s中,规定初始栈顶指针s->top设为Maxsize,那么对栈s进行元素x的进栈操作,下述正确的是() A: s->top++; s->data[s->top]=x; B: s->data[s->top]=x; s->top++; C: s->top--; s->data[s->top]=x; D: s->data[s->top]=x; s->top--;
- 25.向一个栈顶指针为top的链栈中插入一个结点,则执行( )。 A: s->next=top;top=s B: s->next=top->next; top->next =s C: top->next =s D: s->next=top; top=top->next
- 已知带头结点的链栈top, 则元素x对应的新结点s进栈操作的语句是() A: s->next=top->next;top->next=s; B: top->next=s; s->next=top->next; C: s->next=top;top =s; D: top =s; s->next=top;
- 已知顺序栈的地址为s,此时栈不满且栈顶指示器top指向真实栈顶,执行元素x进栈操作错误的语句是( ) A: s->elem[++s->top]=x; B: s->top++;s->elem[s->top]=x; C: s->top= s->top+1;s->elem[s->top]=x; D: s->elem[s->top]=x;s->top++;