未分类题

对于长度为m(m>1)的指定序列,通过初始为空的一个栈、一个队列后,错误的叙述是( )。
D.入栈序列与出栈序列关系为1:1,而入队序列与出队序列关系是1:n(n≥1)

A.若入栈和入队的序列相同,则出栈序列和m队序列可能相同
B.若入栈和入队的序列相同,则出栈序列和出队序列可以互为逆序
C.入队序列与出队序列关系为1:1,而入栈序列与出栈序列关系是1:n(n≥1)

【参考答案】

D
解析:本题考查数据结构基础知识。
队列的元素按特点是先进先出。对于队列,元素的进入次序和出队的次序相......

(↓↓↓ 点击下方‘点击查看答案’看完整答案 ↓↓↓)
热门 试题

未分类题
Why is【S1】fun?What delights may its practitioner expect as his reward?First inthe sheer joy of making things.As the child delights in his mud pie,SO the aduIt enjoys buildingthings,especially things of his own design.Second is the pleasure of making things that are usefulto other peoplE.Third is the fascination of fashioning complex puzzle—like objects of interlockingmoving parts and watching them work in subtle cycles,playing out the consequences 0f pfineiplesbuilt in from the beginning.Fourth is the joy of always learning,which spfings from the【S2】——nature of the task.In one way or another the problem is ever new,arid its solver leams somE.thing:sometimes 【S3】. sometimes theoretical,and sometimes both.Finallv.there is thedelight of working in such a tractable medium.The【S4】,like the poet,works 0nly slightlyremoved from pure thought—stufF.Few media of creation are so flexible,SO easy to polish and rework,SO readily capable of realizing grand conceptual structures.Yet the program【S5】,unlike the poet’s words,is real in the sense that it moves andworks,producing visible outputs separate from the construct itselF.It prints resuhs,draws pictures.produces sounds,moves arms.Programming then is fun because it gratifies creative longings builtdeep within US and delights sensibilities we have in common with all men.【S1】A.programmingB.composingC.WOrkingD.writing
A.As
B.Second
C.Third
D.Fourth
E.In
F.thing:sometimes
G.Finallv.there
H.The【S4】,like
I.Yet
J.It
K.produces
L.Programming
M.
【S1】
A.programming
B.composing
C.WOrking