Queues and stacks

Queues and stacks are widely used data structures. You might be familiar with queues, but internally, stacks are also used everywhere. Every time you make a function call in your code, stack operations are executed.

The reason discuss both data structures in the same chapter is that they can be easily implemented with linked lists.

Queues

Task example

Queue API

Implementation based on linked lists

Stacks

results matching ""

    No results matching ""