Computing Atlas

How Computing Was Built
Sign In
Text size
100%
Theme
Algorithm

Shunting Yard Algorithm

String Algorithm

The shunting yard algorithm is a method for parsing arithmetical or logical expressions written in infix notation, producing either a postfix reverse Polish notation string or an abstract syntax tree. It was invented by Edsger Dijkstra, first published in November 1961 and named for its resemblance to the operation of a railroad shunting yard; it is stack-based, reads each input symbol in order, correctly parses all valid infix expressions though it does not reject every invalid one, and was later generalized into operator-precedence parsing.

Facts
Time Complexity
Time Complexity (category)
Linear Time -- O(n) 1
Connections

Credited To

Source Shunting yard algorithm (Wikipedia)

In Field

Source Shunting yard algorithm (Wikipedia)

Invented By

Edsger W. Dijkstra described the shunting yard algorithm for parsing mathematical expressions in a 1961 report.

Source Wikipedia: Edsger W. Dijkstra
Sources
1. Shunting yard algorithm (Wikipedia)
  • Lead section
    In computer science, the shunting yard algorithm is a method for parsing arithmetical or logical expressions, or a combination of both, specified in infix notation.
  • In Field: Algorithms and Complexity Theory, Lead sentence
    shunting yard algorithm is a method for parsing arithmetical or logical expressions, or a combination of both, specified in infix notation.
View the Source
Comments (0)
No comments yet. Be the first to share a thought.
Reader Challenges (0)
No disputes yet. Spotted an error or a better source? Open the first one.