A: S->top=p;
B: p->next=S->top;S->top=p;
C: p->next=S->top;S->top=p->next;
D: p=S->top;S->top=p;
举一反三
- 链栈S的栈顶指针为top,不能执行出栈操作的是() A: p=S->top;S->top=p->next; B: p=S->top;S->top=p; C: p=S;S->top=p->next; D: p=S->top;S->top=p->next->next;
- 已知带头结点的链栈top,则元素x对应的新结点s进栈操作的语句是() A: top->next=s;s->next=top->next; B: s->next=top->next;top->next=s; C: s->next=top;top=s; D: top=s;s->next=top;
- 已知带头结点的链栈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;
- 若不带头结点的链栈其栈顶指针为top,则插入一个s指针所指向的结点时,应进行如下()操作。 A: s->next=top; top=s; B: s->next=top->next; top->next=s; C: s->next=top; top->next=s; D: top>next = s;
- 若不带头结点的链栈其栈顶指针为top,则删除栈顶元素,应进行如下()操作。 A: top=top->next; s=top;free(s); B: s=top; top=top->next; free(s); C: s=top->next; top->next=s->next;free(s); D: s=top; top->next=s->next;free(s);
内容
- 0
设带有头结点链栈,其栈项指针为top,向链栈中插入一个s结点时,则执行() A: s->next=top->next; top->next=s B: s->next=top->next; top=s C: s->next=top; top->next=s D: top->next=s; s->next=top->next
- 1
在循环双链表的p所指结点之后插入s结点的操作是( ) A: p->next=s; s->pre=p; p->next->pre=s; s->next=p->next; B: p->next=s; p->next->pre=s; s->pre=p; s->next=p->next; C: s->pre=p; s->next=p->next; p->next->pre=s; p->next=s; D: s->pre=p; s->next=p->next; p->next=s; p->next->pre=s;
- 2
在循环双链表的p所指结点后插入s所指结点的操作是( )。 A: s->prior=p; s->next=p->next; p->next=s; p->next->prior=s; B: p->next=s; p->next->prior=s; s->prior=p; s->next=p->next; C: p->next=s; s->prior=p; p->next->prior=s; s->next=p->next; D: s->prior=p; s->next=p->next; p->next->prior=s; p->next=s;
- 3
在循环双链表的P所指节点之后插入s所指节点的操作是( ) A: p->next=s; s->prior=p; p->next->prior=s; s->next=p->next; B: p->next=s; p->next->prior=s; s->prior=p; s->next=p->next; C: s->prior=p; s->next=p->next; p->next=s; p->next->prior=s; D: s->prior=p; s->next=p->next; p->next=s;p->next->prior=s;
- 4
在循环双链表的p所指的结点之前插入s所指结点的操作是 ( ) A: p->;prior = s;s->;next = p;p->;prior->;next = s;s->;prior = p->;prior; B: p->;prior = s;p->;prior->;next = s;s->;next = p;s->;prior = p->;prior; C: s->;next = p;s->;prior = p->;prior;p->;prior = s;p->;prior->;next = s; D: s->;next = p;s->;prior = p->;prior;p->;prior->;next = s;p->;prior = s;