objectives;
To learn how to implement and apply the stack data structure in evaluating arithmetic,
relational and logical expressions
INPUT
a. The input is an INFIX expression.
b. Operands are limited to positive integers (no need to consider negative numbers or
floating-point numbers)
c. Operators include:
i. Arithmetic operators: +, -, *, /, %, ^ (caret is for exponentiation)
ii. Relational operators: >, <, >=, <=, !=, ==
iii. Logical operators: !, &&, ||
d. Parentheses are used as grouping symbols.
e. Assumption: for simplicity let us assume that the INFIX expression is stored in a
string with at most 256 characters.
gowon park is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1