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

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
主站蜘蛛池模板: 鹤山市| 长治市| 九龙城区| 玉环县| 青州市| 肃南| 永善县| 江西省| 沙湾县| 漯河市| 昭苏县| 广安市| 临汾市| 博兴县| 呈贡县| 石嘴山市| 抚州市| 东莞市| 金川县| 舒兰市| 阳山县| 遂宁市| 水城县| 定安县| 雅安市| 青川县| 茂名市| 乌鲁木齐县| 凭祥市| 武陟县| 东至县| 嫩江县| 星座| 株洲市| 富裕县| 广河县| 新津县| 宿松县| 纳雍县| 庐江县| 两当县|