CodeCookbook

Shunting Yard

Infix → Postfix (Dijkstra, 1961). Operator stack + output queue; precedence and associativity decide what to pop and when.

Tokens

3+4*2/(1-5)^2^3
● number● operator● parendim = already processed · solid = current

State

Operator stack· depth 0

(empty)

↑ top

Output queue (postfix)· 0 tokens

(empty)

Step 1 of 23

Begin. Read tokens left to right. Numbers go straight to output; operators are buffered on a stack ordered by precedence.

1 / 23