Skip to content

The calculator evaluates an expression in postfix and give its output

Notifications You must be signed in to change notification settings

joelkanyi/RPN-Postfix-Calculator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

RPN-Postfix-Calculator

The calculator evaluates an expression in postfix and give its output Algorithm: --> Create a stack to store oprerands(Values)

--> Scan the given expression and do the following for every scanned element:

	->If the element is a number, push it to the stack

	->If the element is an operator, pop two operands from the stack evalaute the two popped elements with the current operator and push the result back to the stack.
  
--> When the expression is ended, the top element in the stack is the answer (pop())

About

The calculator evaluates an expression in postfix and give its output

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages