Prefix Expression

how to evaluate prefix expression

Page 1 of 1

4 Replies - 4661 Views - Last Post: 03 October 2010 - 03:35 PM

#1 Guest_Anddy*


Reputation:

Prefix Expression

Posted 03 October 2010 - 03:03 AM

i know we use stack to evaluate postfix expression. I wanna know how to evaluate prefix expression?
Is This A Good Question/Topic? 0

Replies To: Prefix Expression

#2 newclearner   User is offline

  • D.I.C Regular

Reputation: 103
  • View blog
  • Posts: 302
  • Joined: 29-September 10

Re: Prefix Expression

Posted 03 October 2010 - 04:20 AM

View PostAnddy, on 03 October 2010 - 02:33 PM, said:

i know we use stack to evaluate postfix expression. I wanna know how to evaluate prefix expression?



Show us what you know or what you have done. Post code/pseudocode and tell us the errors/issues you coming across.

Happy to help. :)
Was This Post Helpful? 0
  • +
  • -

#3 Guest_Anddy*


Reputation:

Re: Prefix Expression

Posted 03 October 2010 - 05:09 AM

I know this following algorithm to Evaluate Postfix Expression (attached file). Can you give me solution how to solve pefix expression.

Attached File(s)


Was This Post Helpful? 0

#4 newclearner   User is offline

  • D.I.C Regular

Reputation: 103
  • View blog
  • Posts: 302
  • Joined: 29-September 10

Re: Prefix Expression

Posted 03 October 2010 - 07:25 AM

View PostAnddy, on 03 October 2010 - 04:39 PM, said:

I know this following algorithm to Evaluate Postfix Expression (attached file). Can you give me solution how to solve pefix expression.



Hey Anddy,

I have attached a file explaining the algorithm for evaluating prefix expression using stack. Go through it. Lets start with second section(Loop While) mentioned in the doc. Implement it and get back to teh thread.

Happy to help. :)

Attached File(s)


Was This Post Helpful? 1
  • +
  • -

#5 macosxnerd101   User is offline

  • Games, Graphs, and Auctions
  • member icon




Reputation: 12800
  • View blog
  • Posts: 45,992
  • Joined: 27-December 08

Re: Prefix Expression

Posted 03 October 2010 - 03:35 PM

View PostAnddy, on 03 October 2010 - 08:09 AM, said:

I know this following algorithm to Evaluate Postfix Expression (attached file). Can you give me solution how to solve pefix expression.

I also want to reiterate rule #1. We are happy to help you with your good faith efforts, but we will not hand you the code.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1