Sagar Shah
BAN USER- 6of 6 votes
AnswerPhone Interview with Collabedit.
- Sagar Shah in United States
/** Compute the value of an expression in Reverse Polish Notation. Supported operators are "+", "-", "*" and "/".
* Reverse Polish is a postfix mathematical notation in which each operator immediately follows its operands.
* Each operand may be a number or another expression.
* For example, 3 + 4 in Reverse Polish is 3 4 + and 2 * (4 + 1) would be written as 4 1 + 2 * or 2 4 1 + *
*
* @param ops a sequence of numbers and operators, in Reverse Polish Notation
* @return the result of the computation
* @throws IllegalArgumentException ops don't represent a well-formed RPN expression
* @throws ArithmeticException the computation generates an arithmetic error, such as dividing by zero
*
* <p>Some sample ops and their results:
* ["4", "1", "+", "2.5", "*"] -> ((4 + 1) * 2.5) -> 12.5
* ["5", "80", "40", "/", "+"] -> (5 + (80 / 40)) -> 7
*/| Report Duplicate | Flag | PURGE
Linkedin Android Engineer Data Structures
Reparlinenwalters, Software Analyst at ASAPInfosystemsPvtLtd
I Performed extensive web research to collect pertinent data and gather images related to the assigned articleIts act of writing ...