Infix to Reverse Polish notation

  • Thread starter Thread starter itech4814
  • Start date Start date
  • Tags Tags
    Notation Reverse
Click For Summary
The discussion focuses on converting the infix expression X=A+((B+C)*D)-E into reverse Polish notation (RPN). The initial conversion proposed is BC+D*A+E-, which is confirmed as correct by a participant using an HP calculator that employs RPN. The conversation also mentions that there are alternative methods for conversion, including one that maintains the original sequence of numbers from the infix expression, which could be beneficial for programming purposes in infix to RPN conversion.
itech4814
Messages
10
Reaction score
0
I have to convert..

X=A+((B+C)*D)-E

to reverse polish notation

I think it's...

BC+D*A+E-

Is this correct?
 
Technology news on Phys.org
Looks right to me.
 
Yes, that's one way to do it (verified on my HP calculator that uses RPN).

There are other ways, of course. For example, there's one that has the numbers in the sequence that they appear in the original infix expression. Can you figure that one out? It might be useful if you have to write a program that converts infix to RPN.
 
I tried a web search "the loss of programming ", and found an article saying that all aspects of writing, developing, and testing software programs will one day all be handled through artificial intelligence. One must wonder then, who is responsible. WHO is responsible for any problems, bugs, deficiencies, or whatever malfunctions which the programs make their users endure? Things may work wrong however the "wrong" happens. AI needs to fix the problems for the users. Any way to...

Similar threads

  • · Replies 17 ·
Replies
17
Views
2K
Replies
12
Views
2K
Replies
55
Views
6K
  • · Replies 5 ·
Replies
5
Views
819
Replies
7
Views
8K
  • · Replies 7 ·
Replies
7
Views
1K
  • · Replies 8 ·
Replies
8
Views
3K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 25 ·
Replies
25
Views
6K
Replies
1
Views
3K