ADS 2 Mid-term CW
This coursework is in the form of a project. You are asked to design and implement software and write a report on your activities.
Postfix++
Postfix++ is a stack-based computer language directed at the evaluation of arithmetic expressions. You will implement a Postfix++ interpreter that can evaluate Postfix++ code line-byline, as entered, for example, on a mobile device.
Postfix arithmetic
Operators, in postfix arithmetical expressions, follow operands. For example, 3 4 + means 3 + 4. The postfix expression 3 4 5 + * is evaluated as follows:
3 4 5 + *
3 9 * (replace 4 5 + with the result of adding 4 to 5)
27 (replace 3 9 * with 27)
Postfix expressions are conveniently evaluated using a stack. An expression consisting of operands and operators (collectively, ‘tokens’), is read from left to right. Successive operands are pushed on a stack until an operator arrives. The appropriate number of operands are then popped from the stack, combined with the operator, and the result is pushed back on the stack. The result of a calculation is always to be found at the top of the stack. A stack is notated [a b c…] in the following example; the stack top is the leftmost token.
Buy Answer of This Assessment & Raise Your Grades
The post You are asked to design and implement software and write a report on your activities: Algorithms and data structure Course Work, UOG, UK appeared first on Students Assignment Help UK.