Price your future right. 60% off with code BLACKSCHOLES at USD checkout. Offer ends in 1d 16h 01m 49s1 days 16 hours 1 minutes 49 seconds.
Price your future right. 60% off with code BLACKSCHOLES at USD checkout. Offer ends in 1d 16h 01m 49s1 days 16 hours 1 minutes 49 seconds.

Sign in to watch this lesson
Algorithms - Strings · 4:22
Reverse Polish notation puts every operator after its operands, so one stack evaluates it in a single pass. The two-stack parser (Dijkstra's shunting yard) turns ordinary infix into that order with one rule: before pushing an operator, fire every stacked operator of equal or higher priority, with parentheses acting as walls. We run it on a + b * c * d + (e - f) * (g * h + i), then add right associativity for powers and unary minus, and finish with the compile-once, evaluate-every-tick pattern used for risk rules.