题目详情

某双端队列如下所示,要求元素进出队列必须在同一端口,即从A端进入的元素必须从A端出、从B端进入的元素必须从B端出,则对于4个元素的序列e1、e2、e3、e4,若要求从前2个元素(e1、e2)从A端口按次序全部进入队列,后两个元素(e3、e4)从B端口按次序全部进入队列,则可能得到的出队序列是()。

初级程序员,章节练习,基础复习,综合练习

  • A.e1、e2、e3、e4
  • B.e2、e3、e4、e1
  • C.e3、e4、e1、e2
  • D.e4、e3、e2、e1

正确答案及解析

正确答案
D
解析

根据题意,从A端进入的元素必须从A端出、从B端进入的元素必须从B端出;则A端出队顺序是e2e1,B端出队顺序是e4e3。只有选择D符合要求。

你可能感兴趣的试题

单选题

(  )is the process of transforming information so it is unintelligible to anyone but the intended recipient.

  • A.Encryption
  • B.Decryption
  • C.Security
  • D.Protection
查看答案
单选题

As each application module is completed,it undergoes(  )to ensure that it operates correctly and reliably.

  • A.unit testing
  • B.integration testing
  • C.system testing
  • D.acceptance testing
查看答案
单选题

(  )algorithm specifies the way to arrange data in a particular order.

  • A.Search
  • B.Random
  • C.Sorting
  • D.Merge
查看答案
单选题

After analyzing the source code,(  )generates machine instructions that will carry out the meaning of the program at a later time.

  • A.an interpreter
  • B.a linker
  • C.a compiler
  • D.a converter
查看答案
单选题

(  )can help organizations to better understand the information contained within the data and will also help identify the data that is most important to the business and future business decisions.

  • A.Data processing system
  • B.Big Data analytics
  • C.Cloud computing
  • D.Database management
查看答案

相关题库更多 +