• (2 Pages)
  • +
  • 1
  • 2

Converting and Evaluating Infix, Postfix and Prefix Expressions in C Rate Topic: ***** 5 Votes

#16 young eng  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 23-June 11

Posted 23 June 2011 - 03:48 PM

plz i cant understand the stack operations,and iwant to know if the code is written in c or c++?
Was This Post Helpful? 0
  • +
  • -

#17 Trakker  Icon User is offline

  • A$$hole Extraordinaire.
  • member icon

Reputation: 13
  • View blog
  • Posts: 2,386
  • Joined: 06-June 01

Posted 24 November 2011 - 05:30 PM

Thanks born2code, it's rare to find a clear explanation such as yours on topics such as this.
Appreciate your hard work.
I'll have to poke around at the code later, came here for the explanation of infix - prefix - postfix.

I'd add that after making an expression tree from a given expression, to produce the prefix notation, you write down the element the first time it is seen during traversal, for postfix, you write it down the last time it is seen during traversal. That is how it clicked for me.
Was This Post Helpful? 0
  • +
  • -

  • (2 Pages)
  • +
  • 1
  • 2