Back to problems

Expression Evaluation with Variables

Algorithm · Instacart · Hard

Examples Example 1 Example 2 Requirements The input consists of variable assignments or equations together with arithmetic expressions. A variable may be assigned a numeric constant or may refer to another variable. Arithmetic supports basic + and -; in some versions, the syntax also resembles a basic calculator and allows parentheses. Compute the result of the requested variable or expression. When robustness is required, report variables that were never defined and…

Checking your access…