Groovy Algorithms: Shunting Yard
Groovy’s sugary syntax makes coding algorithms — dare I say it — fun. The shunting yard algorithm, invented by Dutch computer scientist Edsger Dijkstra, is used to parse mathematical expressions. You might have picked up on this already, but computers and people think differently. We commonly use infix notation to write mathematical expressions. It is what you learned in school. For example: “3 * (2 + 3)”. Makes sense to you, but it is inefficient for a computer to process. …