Subtopic 4.1
Stack with an Array
4lessons19 min0done
A stack built on an array keeps its elements in a fixed-size array and knows where the top is through the top index. In an empty stack top is -1.
Each operation is its own lesson: creating, push, pop and peek. Because the array has a fixed size, overflow is a real case here and is checked before every push.