官术网_书友最值得收藏!

Creating Queues for In-Order Executions

A queue is a programming construct that bears a heavy resemblance to real-world queues, for example, a queue at the movie theater, ATMs, or the bank. Queues, as opposed to stacks, are first-in first-out (FIFO), so whatever goes in first comes out first as well. This is especially helpful when you would like to maintain data in the same sequence in which it flows in.

A more computer/scientific definition of a queue would be as follows: 

An abstract data collection in which the elements can be added to the back called enqueue and removed from the front called dequeue which makes it a FIFO data structure.

Of course, having only enqueue and dequeue operations may be enough for the majority of cases to cover a wider spectrum of issues that we may encounter; however, we can expand the API and make our queue future-proof. 

In this chapter, we will discuss the following topics:

  • Types of queue
  • Implementation of different types of queue
  • Use cases showing the usefulness of queues
  • Performance of queues as compared to other native data structures
主站蜘蛛池模板: 凯里市| 岚皋县| 民和| 鹤峰县| 巫山县| 长阳| 全椒县| 麻城市| 桃江县| 枝江市| 芜湖县| 阿拉善右旗| 武鸣县| 会同县| 江陵县| 泰来县| 宁强县| 甘肃省| 遂平县| 婺源县| 娄烦县| 武胜县| 朝阳区| 永新县| 建水县| 太原市| 永修县| 天祝| 龙口市| 枣庄市| 云南省| 乌拉特后旗| 呼图壁县| 金乡县| 青铜峡市| 六安市| 林周县| 新源县| 逊克县| 德化县| 丽水市|