Infix to Reverse Polish notation

  • Thread starter Thread starter itech4814
  • Start date Start date
  • Tags Tags
    Notation Reverse
Click For Summary
SUMMARY

The discussion focuses on converting the infix expression X=A+((B+C)*D)-E to Reverse Polish Notation (RPN). The correct RPN representation is confirmed as BC+D*A+E-. Participants mention alternative methods for conversion, including retaining the original sequence of numbers from the infix expression. This insight is particularly useful for programming applications that require infix to RPN conversion.

PREREQUISITES
  • Understanding of infix notation and its structure
  • Familiarity with Reverse Polish Notation (RPN)
  • Basic programming skills for implementing conversion algorithms
  • Knowledge of stack data structures for expression evaluation
NEXT STEPS
  • Research algorithms for converting infix expressions to RPN
  • Learn about stack data structures and their applications in expression evaluation
  • Explore programming languages that facilitate RPN calculations, such as Python or Java
  • Investigate different methods of RPN representation and their use cases
USEFUL FOR

Students, software developers, and computer science enthusiasts interested in expression evaluation and algorithm design will benefit from this discussion.

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.
 

Similar threads

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