- Hands-On Data Structures and Algorithms with JavaScript
- Kashyap Mukkamala
- 193字
- 2021-06-30 19:12:12
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
- DBA攻堅指南:左手Oracle,右手MySQL
- Python語言程序設計
- SQL語言從入門到精通
- C語言實驗指導及習題解析
- Rust Essentials(Second Edition)
- 零基礎學單片機C語言程序設計
- Instant Lucene.NET
- Mastering Concurrency in Python
- 零基礎學Java第2版
- JavaEE架構與程序設計
- Puppet 5 Beginner's Guide(Third Edition)
- 熱處理常見缺陷分析與解決方案
- Flutter for Beginners
- 邊做邊學深度強化學習:PyTorch程序設計實踐
- Web前端開發全程實戰:HTML5+CSS3+JavaScript+jQuery+Bootstrap