10 points Question 2 : Errors in Code Below is a function postfirBval that is supposed to read a queue of char tokens an

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899604
Joined: Mon Aug 02, 2021 8:13 am

10 points Question 2 : Errors in Code Below is a function postfirBval that is supposed to read a queue of char tokens an

Post by answerhappygod »

10 Points Question 2 Errors In Code Below Is A Function Postfirbval That Is Supposed To Read A Queue Of Char Tokens An 1
10 Points Question 2 Errors In Code Below Is A Function Postfirbval That Is Supposed To Read A Queue Of Char Tokens An 1 (78 KiB) Viewed 44 times
10 points Question 2 : Errors in Code Below is a function postfirBval that is supposed to read a queue of char tokens and evaluates them as postfix notation (assuming there are only has and + operations). If the postfix expression isn't formatted correctly it should print a warning to the user and return -1. Otherwise you should return value produced by the expression. The program should not leak any memory Example: input: 5321 output: 35 Since 5.(3-2) + 1) = 5(6+1)=5.7 – 35 1 int *poutfixEval( Queue *pg Stack pa - createStack(); 2 while in Empty (pq) ) { char aym - dequeue ps): T 11( aym !- + || Bym != 1) push(ps, next): 10 11 elet char y poppa > char x-pop pa: 11 wym pushpa. x+y): ola pushpany > 1 ant nettoppa 20 it Ceptу Крик acan (Poutti expression formatted incorrectlyin" retum - Freequete pa: rotunet
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply