Zelaron Gaming Forum  
Stats Arcade Portal Forum FAQ Community Calendar Today's Posts Search
Go Back   Zelaron Gaming Forum > The Zelaron Nexus > Science and Art > Tech Help

 
 
Thread Tools Display Modes

 
Infix to Postfix
Reply
Posted 2007-03-26, 09:53 PM
Given the infix: ( 2 + 3 * 5 - ( 2 * 6 ^ 2 ) * 4 + ( ( 3 + 2 ) * 5 ) - 6 ) / 1

Could anyone check whether or not the following is the correct postfix?

2 3 5 * 2 6 2 ^ * 4 * 3 2 + 5 * + 6 - - + 1 /

In my testing phase that's what my program converted the infix to, and that's the same thing I got by hand, however evaluating the infix expression, both by hand and computer I get -252, yet both by computer and by hand I get -290 for the postfix expression. If someone could tell me whether or not I converted to postfix correctly I would greatly appreciate it, as it would help me isolate whether my evaluation method is incorrect or whether my conversion method is incorrect.
Old
Profile PM WWW Search
Demosthenes seldom sees opportunities until they cease to beDemosthenes seldom sees opportunities until they cease to beDemosthenes seldom sees opportunities until they cease to beDemosthenes seldom sees opportunities until they cease to be
 
Demosthenes
 



 
Reply
Posted 2007-03-26, 10:28 PM in reply to Demosthenes's post "Infix to Postfix"
Not that I claim to understand, but:
2 3 5 * 2 6 2 ^ * 4 * 3 2 + 5 * + 6 - - + 1 /
2 (3*5) 2 (6^2) * 4 * (3+2) 5 * + 6 - - + 1 /
2 (3*5) (2*(6^2)) 4 * ((3+2)*5) + 6 - - + 1 /
2 (3*5) ((2*(6^2))*4) ((3+2)*5) + 6 - - + 1 /
2 (3*5) (((2*(6^2))*4)+((3+2)*5)) 6 - - + 1 /
2 (3*5) ((((2*(6^2))*4)+((3+2)*5))-6) - + 1 /
2 ((3*5)-((((2*(6^2))*4)+((3+2)*5))-6)) + 1 /
(2+((3*5)-((((2*(6^2))*4)+((3+2)*5))-6))) 1 /
(2+((3*5)-((((2*(6^2))*4)+((3+2)*5))-6)))/1
(2+3*5-2*6^2*4+(3+2)*5-6)/1
Old
Profile PM WWW Search
WetWired read his obituary with confusionWetWired read his obituary with confusionWetWired read his obituary with confusionWetWired read his obituary with confusion
 
 
WetWired
 
 

Bookmarks

« Previous Thread | Next Thread »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules [Forum 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 On
HTML code is Off
Forum Jump


All times are GMT -6. The time now is 02:53 AM.
'Synthesis 2' vBulletin 3.x styles and 'x79' derivative
by WetWired the Unbound and Chruser
Copyright ©2002-2008 zelaron.com
Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
This site is best seen with your eyes open.