algoritmauzmanı
Sign in
TREN
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 index. In an empty stack top is -1.

Each operation is its own lesson: creating, , and . Because the array has a fixed size, is a real case here and is checked before every push.

Lesson 4.1.1 Creating an array stack5 min