August 2023
Intermediate to advanced
265 pages
3h 55m
English
This chapter introduces you to queues and stacks, along with several Python code samples that show you basic functionality involving these two data structures.
The first part of this chapter explains the concept of a queue, along with code samples that show you how to perform various operations on a queue. Some of the code samples also contain built-in functions for queues, such as isEmpty(), isFull(), push(), and dequeue().
The second part of this chapter explains the concept of a stack, along with code samples that show you how to perform various operations on a stack. In addition, you will see code samples for finding the largest and smallest elements in a stack and reversing the contents of a stack.
The final ...
Read now
Unlock full access