Summary

In this chapter, you have learned about three limited access data structures, namely stacks, queues, and priority queues. It is worth remembering that such data structures have strictly specified ways of accessing elements. All of them also have various real-world applications, and some have been mentioned and described in this book.

First, you saw how the stack operates according to the LIFO principle. In this case, you can only add an element at the top of the stack (the push operation), and only remove an element from the top (the pop operation). The stack has been shown in two examples, namely for reversing a word and for solving the Tower of Hanoi mathematical game.

In the following part of the chapter, you got to know the queue ...

Get C# Data Structures and Algorithms now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.