Ad
  • Custom User Avatar

    @Opaldes
    Well, my solution is similar although I used an actual stack (well a Linked List, which can be used as a stack). I'm not sure if you've formally had Computer Science education, but I would say the two relevant classes I took are Automata Theory/Theory of Computation and Compilers. This problem basically boils down to parsing, which compilers do a lot of, although Grey is correct about the shift-reduce (I've actually had to do it by hand on exams). Automata Theory teaches the the theory of finite automata and regular languages and pushdown automatas and context free languages and turing machines and context sensitive languages. The two courses are very interrelated (Register Allocation in Compilers is related to Four Color Theorem in Automata Theory; Type Systems in Compilers is related to the Halting Problem in Automata Theory). Lectures from the Compilers class that I took: https://www.cs.umd.edu/class/spring2016/cmsc430/Schedule.html .