LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-03-2013, 11:42 AM   #1
lxmirmsh
LQ Newbie
 
Registered: Nov 2012
Location: India
Posts: 23

Rep: Reputation: Disabled
Conversion code


The easiest and smallest code available to convert infix expression to postfix expression.
Can somebody give the code?
 
Old 06-03-2013, 11:47 AM   #2
jdkaye
LQ Guru
 
Registered: Dec 2008
Location: Westgate-on-Sea, Kent, UK
Distribution: Debian Testing Amd64
Posts: 5,465

Rep: Reputation: Disabled
Can you show us what you've done so far?
jdk
 
Old 06-03-2013, 11:59 AM   #3
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,912

Rep: Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513
Sounds like a homework assignment.

And you didn't even google for various solutions already on the net.
 
Old 06-03-2013, 12:34 PM   #4
lxmirmsh
LQ Newbie
 
Registered: Nov 2012
Location: India
Posts: 23

Original Poster
Rep: Reputation: Disabled
No! not a homework. I have a program that converts an infix expression to a parse tree. wanted to see if it can convert a postfix expression as well, so figured, maybe if i added a small fragment to convert infix to postfix in the code,it'll all work out. But i don't seem to find any small code. All the codes i came across have taken the long route. So i was just wondering if there is a smaller version which could perform the same action.
 
Old 06-03-2013, 01:02 PM   #5
johnsfine
LQ Guru
 
Registered: Dec 2007
Distribution: Centos
Posts: 5,286

Rep: Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197
Quote:
Originally Posted by lxmirmsh View Post
The easiest and smallest code available to convert infix expression to postfix expression.
Quote:
Originally Posted by lxmirmsh View Post
I have a program that converts an infix expression to a parse tree. wanted to see if it can convert a postfix expression as well, so figured, maybe if i added a small fragment to convert infix to postfix in the code,it'll all work out.
Did you mean "convert to" rather than "convert"? In that context, "convert" would mean "convert from", which is opposite your original request.

Almost all the code needed to convert from infix to parse tree is the same as almost all the code needed to convert from infix to postfix.

If you already have code to convert infix to parse tree, it should be trivial to add code to make it convert to postfix as well or optionally instead.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
MQ LINUX vs MQ Unix Conversion Differences - LINUX Conversion Issues catch93 Linux - Newbie 4 11-03-2011 09:10 PM
C++ standard wide iostreams code conversion - outputs garbage yeye_olive Programming 5 10-04-2009 01:09 PM
qmail uni-code to sJIS Conversion sridhar11 Debian 0 07-21-2006 04:49 AM
Code Conversion Help Needed fpfernando Programming 2 10-09-2005 11:36 PM
User Preferences: Use HTML code instead of vB code? (vB code is overrated) stefanlasiewski LQ Suggestions & Feedback 5 07-26-2005 01:37 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:21 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration