What is a stack and how it works? What is an Abstract data type and how it’s related with the stack? In this post we’ll explore the stack data structure, I’ll go through the theory behind, explain why stacks are important programming tools, create a custom implementation of a stack with an array from scratch and finally, go through some interesting examples. By the end of this post I do hope that you’ll have a very good understanding of how a stack works under the hood and how you can use it to tackle day-to-day programming problems.
This is the first post in the series on Learning data structures. What this series aims is to provide basic knowledge on some popular data structures and their algorithms, their use cases and how such knowledge can unleash your potential into thinking and solving problems. In this series I’ll focus primarily in the C# language but I might discuss some topics in the F# language as well, for the most part though I will materialize theory in C# code.
In this post I will discuss about the most fundamental data structure in computer science, arrays.