Most of the time you don't build a stack — your language already has one. This lesson shows the built-in stack in each language, the mistakes people make with them, and then how to build your own stack on a linked list so you know exactly what happens underneath.
Here is the same small job in all four: push some values, then pop until the stack is empty. The values come out reversed.
Free account
Sign up to read the rest of this lesson: 4 more sections, 2 drawings, a dry-run simulator and code in JavaScript, Python, Java and C++.
Still to come