Save Time & improve Grades
- Questions Asked
- Experts
- Total Answered
Start Excelling in your courses, Ask an Expert and get answers for your homework and assignments!!
I would like you to perform Polish Notation Math. I have produced a list of math problems, simple ones, but, they will require you to use two stacks to make them work. You are to break them down into two stacks, one is the numbers and the other being the operation. Pop from the operations stack and perform the math.
KEEP IN MIND THE ORDER OF OPERATIONS IS VERY IMPORTANT, AND YOU MIGHT WANT TO BUILD A METHOD TO INDICATE SUCH. THIS WILL SAVE YOU A LOT OF MISERY.
Another point you should keep in mind, it is not about the answer it is about the process. And if you can do stacks, which I have always found exceedingly utilitarian, you can do queues.
DON'T USE DICTIONARIES LIST OR ARRAYS ONLY. AND WRITE A PROCESS FOR POPPING AND PUSHING FROM THE STACK, IN PYTHON IT HAS A PREDEFINED METHOD FOR THIS, DON'T USE IT, WRITE YOUR OWN
https://www.tutorialspoint.com/data_structures_algorithms/expression_parsing.htm
Ask a question
Experts are online
Answers
Login/SignUp to view answers