473,383 Members | 1,737 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,383 software developers and data experts.

Please give me a idea.

How can i write a c program to covert infix expression to postfix expression using stack concept.
Aug 30 '07 #1
3 1341
Banfa
9,065 Expert Mod 8TB
Google and Wikipedia are your friends
Aug 30 '07 #2
questionit
553 512MB
Elango M

If you find out how infix to postfix conversion and its evaluation works- and if you look at their algorithm, then it would be so easy for you to implement the idea in C.

Qi



How can i write a c program to covert infix expression to postfix expression using stack concept.
Aug 30 '07 #3
JosAH
11,448 Expert 8TB
How can i write a c program to covert infix expression to postfix expression using stack concept.
The basic algorithm runs along the following lines: you scan the infix expression
from left to right; when you read an operand (e.g. a number) you pass it to the
output stream directly; when you read an operator you either push it on a stack
when the operators' priority is larger than the priority of the top element of the
stack (an empty stack has a priority too). If it has lower priority you keep popping
operators from the stack and shift them to the output stream until either the
stack is empty or the first condition is true. You have to figure out the priorities
for the operators (parentheses count as operators too).

kind regards,

Jos
Aug 30 '07 #4

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

Similar topics

0
by: JokeR | last post by:
Hi! I've been doing loads of work using RXTXcomm java class lately, and it was used for communication with serial port (the real one, ttyS0) Now, I have a big problem (at least that's what it...
39
by: Scotter | last post by:
Okay I think my title line was worded misleadingly. So here goes again. I've got quite 20 identical MDB files running on an IIS5 server. From time to time I need to go into various tables and add...
1
by: Az Tech | last post by:
Hi people, (Sorry for the somewhat long post). I request some of the people on this group who have good experience using object-orientation in the field, to please give some good ideas for...
1
by: David Goodyear | last post by:
At the moment im experimenting with ideas in C++ and would really like to solve the following, please please help. Sorry i dont even know what the subject is this would come under? :( Sorry if...
7
by: x muzuo | last post by:
Hi guys, I have got a prob of javascript form validation which just doesnt work with my ASP code. Can any one help me out please. Here is the code: {////<<head> <title>IIBO Submit Page</title>...
14
by: HP | last post by:
Hi All i have confussion regarding given problem please help me out 4. What happens with the following program: void main(){ myclass* pmc = new myclass; pmc = 0; delete pmc;}
2
by: Vai2000 | last post by:
Hi All, To my correct understanding Garbage Collection works based on Generation algorithm...(high level). I have an application which does some heavy operations usually File I/O's. I want to...
5
by: Prakash | last post by:
Hi Friends, While i am searching the c# interview questions in the internet, i got the following questions for Architect level. Please give me the answer for the following questions. (i hope i...
1
by: David Van D | last post by:
Hi there, A few weeks until I begin my journey towards a degree in Computer Science at Canterbury University in New Zealand, Anyway the course tutors are going to be teaching us JAVA wth bluej...
6
by: shapper | last post by:
Hello, I am creating a form that includes a few JQuery scripts and TinyMCE Editor: http://www.27lamps.com/Beta/Form/Form.html I am having a few problems with my CSS: 1. Restyling the Select
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.