how to convert postfix notation into prefix in data
structures. please send me algo of taha



how to convert postfix notation into prefix in data structures. please send me algo of taha..

Answer / Hari Shankar Mehra

To convert postfix notation (RPN, Reverse Polish Notation) into prefix notation, you can use a stack-based algorithm. Here's an example algorithm based on Taha's method:
1. Initialize two empty stacks: output and operators.
2. Iterate through each token in the postfix expression.n - If the token is an operand (e.g., numbers or symbols like +, -, *, /), push it onto the output stack.n - If the token is an operator, pop two operands from the output stack and apply the operator on them. Then, push the result back onto the output stack.
3. The final result will be in the output stack.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Engineering AllOther Interview Questions

Please help to write testcase for ECG machine

1 Answers  


I am some what lagging in talking English but i love to do job as an software engineer what will i do to improve my communication skills? please give me answer..........

2 Answers  


What is protocol

9 Answers   IBM,


i am astubent of BE3rd year currently in 6th semester branch information technology till now i have 73% near about in each semester the problem with me is that i have got only 58%in 12th class n 55%in 10th class bcoz of my health now i am ok i have got 2 year loss also bcoz i have not giveen the exam in class 12th rite now i am prep for GATE i am working hard pls tell will i get a good job in future in the good company bcoz my inter percent were not gud pls tell me help me pls

1 Answers  


how do we calculate physical address if logical address is given in the question?

1 Answers   TCS,


why we select you?

1 Answers  


What is the mistake in the following program segment ? f() { int a; void c; f2(&c,&a);}

1 Answers   Geometric Software,


What is spooling and buffering?

1 Answers  


how we can improve mobile ad,hoc network.

1 Answers  


why this companay? For example: Why Dell?

1 Answers   DELL,


why is the scheduling decision needs to be taken when a process switches from running to waiting state.also,if this is because the next process is to be allocated to cpu then why not a scheduling decision taken when a process switches from ready to running state.

1 Answers  


How Main()is called by opreting system?

1 Answers  


Categories
  • Civil Engineering Interview Questions Civil Engineering (5086)
  • Mechanical Engineering Interview Questions Mechanical Engineering (4453)
  • Electrical Engineering Interview Questions Electrical Engineering (16638)
  • Electronics Communications Interview Questions Electronics Communications (3918)
  • Chemical Engineering Interview Questions Chemical Engineering (1095)
  • Aeronautical Engineering Interview Questions Aeronautical Engineering (239)
  • Bio Engineering Interview Questions Bio Engineering (96)
  • Metallurgy Interview Questions Metallurgy (361)
  • Industrial Engineering Interview Questions Industrial Engineering (259)
  • Instrumentation Interview Questions Instrumentation (3014)
  • Automobile Engineering Interview Questions Automobile Engineering (332)
  • Mechatronics Engineering Interview Questions Mechatronics Engineering (97)
  • Marine Engineering Interview Questions Marine Engineering (124)
  • Power Plant Engineering Interview Questions Power Plant Engineering (172)
  • Textile Engineering Interview Questions Textile Engineering (575)
  • Production Engineering Interview Questions Production Engineering (25)
  • Satellite Systems Engineering Interview Questions Satellite Systems Engineering (106)
  • Engineering AllOther Interview Questions Engineering AllOther (1379)