473,406 Members | 2,356 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

pls help me convert the infix notation to postfix notaion

pls help me fo my assignment that will allow the user to input infinite equations in infix type. and will output in postfix.

thanks!
Aug 30 '08 #1
6 3010
Ganon11
3,652 Expert 2GB
You will need some sort of algorithm first, before you start coding at all. Any ideas?
Aug 30 '08 #2
JosAH
11,448 Expert 8TB
pls help me fo my assignment that will allow the user to input infinite equations in infix type. and will output in postfix.

thanks!
Have you considered Google? Searching for "infix to postfix" gives you loads of
example solutions in lots of languages including C and C++.

kind regards,

Jos
Aug 30 '08 #3
TamusJRoyce
110 100+
1. Try giving us the Regular Expression Grammar in which you plan to do this.

2. After finding that out, then comes how to code that grammar into an algorithm (or pseudo-code of how that grammar should work).

3. Then from that algorithm/pseudo-code we can help you with coding it.

Start with #1, and we'll help you through the steps : )

Also, to note: Latex and Caml are two languages which excel at this type of thing. Worry about your assignment, but it's an interesting note to think about.
Aug 31 '08 #4
JosAH
11,448 Expert 8TB
1. Try giving us the Regular Expression Grammar in which you plan to do this.
Note that a regular expression can't describe the syntax of ordinary infix expressions.
See the pumping lemma for a nice proof.

kind regards,

Jos
Aug 31 '08 #5
TamusJRoyce
110 100+
Ah. The infix type got me. Keep on thinking it's an infinate language, which doesn't make sence.

Thank JosAH
Aug 31 '08 #6
JosAH
11,448 Expert 8TB
Ah. The infix type got me. Keep on thinking it's an infinate language, which doesn't make sence.

Thank JosAH
Both regular languages as well as context free languages can be infinite languages
but, as the pumping lemma clearly shows and as the saying goes: regular languages
can't count. You need to be able to count because of those parentheses that
make up nested expressions. In normal words: you can't come up with a
regular expression that matches a string of well balanced parentheses.

kind regards,

Jos
Aug 31 '08 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: KidLogik | last post by:
Hello! I am converting an infix expression string into a postfix so that I will be able to evaluate it easier -> (5*(((9+8)*(4*6))+7)) == 598+46**7+* I believe the rule is "Replace all...
22
by: Tony Johansson | last post by:
Hello Experts! I'm reading i a book about C++ and they mention infix with telling what it is. I hope you out there can do so. Many thanks! //Tony
19
by: caramel | last post by:
i've been working on this program forever! now i'm stuck and going insane because i keep getting a syntax error msg and i just can't see what the compiler is signaling to! #include <stdio.h>...
6
by: PIEBALD | last post by:
Anyone got an infix to postfix (RPN) math notation converter? I've looked around a bit and haven't found anything quite what I want. I just want a method that will take a string in infix notation...
30
by: Xah Lee | last post by:
The Concepts and Confusions of Prefix, Infix, Postfix and Fully Functional Notations Xah Lee, 2006-03-15 In LISP languages, they use a notation like “(+ 1 2)” to mean “1+2”....
2
by: ostorat_elwafa2 | last post by:
program that uses a stack to convert a given infix expression to a postfix expression and then to evaluate it. program should first check if the infix expression entered has balanced brackets ( ...
3
by: jackikay | last post by:
how do i write a program that converts infix to postfix.?
1
by: aitia | last post by:
this the code. i used ECLIPSE to run this.. it has some codes smells that i can't seem to figure out.. can any one help? import java.io.*; import java.util.*; public class Postfix { private...
2
by: zeroeight | last post by:
Hi guys, I'm a newbie here, I just want to seek for help regarding my program. I want to implement an infix to postfix conversion only accepting numbers. Right now, I already debugged the errors...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.