第二章
1.(2分)假定利用数据a[n]顺序存储一个栈,用top表示栈顶指针,top==-1表示栈空,并已知栈未满,当元素x进栈时执行的操作是()
A.a[top–]=x
B.a[++top]=x
C.a[–top]=x
D.a[top++]=x
2.(2分)用S表示进栈操作,用X表示出栈操作,若元素的进栈顺序是1234,为了得到1342的出栈顺序,相应的操作序列是()
A.SXSXSSXX
B.SXSSXXSX
C.SSSXXSXX
D.SXSSXSXX
3.(2分)用链式存储方式的队列进行删除操作时()
A.头尾指针都要修改
B.仅修改尾指针
C.头尾指针可能都要修改
D.仅修改头指针
4.(2分)一个队列的入队顺序是1,2,3,4,则出队的顺序是()
A.1,4,3,2
B.4,3,2,1
C.1,2,3,4
D.3,2,4,1
5.(2分)
假设循环单链表表示的队列长度为n,队头固定在链表尾部,若只设置头指针,则进队操作的时间复杂度是()
得分/总分
A.
B.
C.
D.
6.()不是栈的基本操作
A.判断栈是否为空
B.将栈置为空栈
C.删除栈顶元素
D.删除栈底元素
7.设链表不带头结点且所有操作均在表头进行,则下列最不适合链栈的是()
A.只有表尾结点指针,没有表头指针的单向循环链表
B.只有表头结点指针,没有表尾指针的单向循环链表
C.只有表头结点指针,没有表尾指针的双向循环链表
D.只有表尾结点指针,没有表头指针的双向循环链表
8.(2分)3个不同元素依次进栈,能得到()种不同的出栈序列
A.7
B.4
C.5
D.6
9.(2分)栈和队列的主要区别在于()
A.它们的逻辑结构不一样
B.它们的存储结构不一样
C.所包含的元素不一样
D.插入、删除操作的限定不一样
10.(2分)在一个链队列中,假设队头指针是front,队尾指针是rear,x所指向的元素需入队,则执行的操作是()
A.rear->next=x, x->next=null, rear=x
B.x->next=front->next, front=x
C.front=x, front=front->next
D.rear->next=x, rear=x
11.(2分)In general,the recursive algorithm is converted into an equivalent non-recursive algorithm that should be set()
A.array
B.queue
C.set
D.stack
12.(2分)The input sequence of the stack is 1,2,3,4,and ()cannot be its output sequence.
A.2,1,3,4
B.4,3,1,2
C.1,4,3,2
D.1,2,4,3
13.(2分)The circular queue A[0…M-1] stores its elements and uses front and rear to represent the header and queue end respectively,while the condition of the full loop queue is ()
A.(Q.rear+1)%m==Q.front
B.Q.rear==Q.front+1
C.Q.rear==Q.front
D.Q.rear+1==Q.front
14.(2分)Both the stack and queue are linear structures that restrict the fetch.
A.√
B.×
15.(2分)Stacks,FIFO queues,double ended queues can be considered as derived classes of a container class. The container represents a sequential access structure that restricts access locations.
A.√
B.×