Lesson 3 of 81961–today7 min

Stacks and queues

In 1961 Edsger Dijkstra described how a compiler could turn an arithmetic expression such as 3 + 4 × 2 into an order a machine can evaluate. His method sent operators into a holding track, like wagons in a railway shunting yard, and released them when an operator of lower priority arrived. It is still called the shunting-yard algorithm.

The holding track was a stack. The same structure keeps track of function calls in every running program, powers the Undo button and checks that your brackets match.

The rest of this lesson is part of Pro

Create a free account to read the first lesson of every path, and go Pro for the rest.

Sources