## Pages

The greatest mistake you can make in life is to be continually fearing you will make one

## Sunday, 7 February 2010

### Arithmetic Expression Evaluation

Arithmetic Expressions
• An expression is a string of symbols
•  Arithmetic expressions are made up of variable names,binary operators and brackets.But in actual computer languages there are many other things such as powers(**),unary minus(-a),numbers(22/7*3.12a) and things like function(a=find(a,b)+c) and array references may be present.
• We are going to consider the expressions with variables(a-z),digits,binary operators(+,-,*,/) and brackets[(-left  & )-right]
• example of some arithmetic expression
a+b-c
a+b+c*d
(a+b)*(c-d)

Types of Expression:
• An expression can be in 3 form
1. Infix Expression
2. Prefix Expression
3. Postfix Expression
• Infix,prefix and postfix notations are different ways of writing expression.
• In the 3 ways, the operands occur in the same order but the operators have to be moved.
• We are using infix type of expression in our daily life but the computer uses postfix or  prefix type of expression
1.Infix Notation:
• Operators are written in between their operands
• This is used in our common mathematical expressions.
• The operations(order of evaluation) are performed from left to right. and it obeys precedence rules ie multiplication and division are performed before addition and subtraction.
• Brackets can be used to change the order of evaluation
• examples
(a)  A+B  (b) X*(Y+Z)

2.Prefix Notation(Polish notation)
• Operators are written before their operands
• order of evaluation from right to left.
• example
(a) +AB   (b)*X+YZ

3.Postfix Notation(Reverse Polish notation)
• Operators are written after their operands
• The order of evaluation of operators is always from left to right
• brackets cannot be used to change the order of evaluation.
• Example
(a) AB+,  (b) XYZ+*

Operator Precedence:

• In the table the precedence is decreasing downwardly
• if there are two operators with same precedence then computer start to solve the expression from left to right
Operator
()
*,/,%
+,-

Arithmetic Expression Evaluation:
• An important application of stacks is parsing. ie a compiler must evaluate arithmetic expressions written using infix notation.
• The problem of parsing infix expression can be break in to 2 stages
1. Infix to Postfix Conversion
2. Evaluating a Postfix expression
• Converting an infix expression in to postfix expression and evaluating a Postfix expression is a easier problem than directly evaluating Infix expression

1. very useful!!!

2. super

3. super but still if you give it points much better

4. nice...

5. do yu have the code?? in java

6. It's appropriate time to make a few plans for the long run and it is time to be happy. I've learn
this submit and if I may just I wish to suggest you some
interesting issues or advice. Perhaps you could write next
articles relating to this article. I wish to learn even more things approximately it!

Have a look at my web page pkv krankenkasse
Feel free to visit my website :

7. Very descriptive blog, I loved that a lot. Will there be a part 2?

My web blog - How to earn money through clickbank
Here is my web site ::

8. Heya i'm for the first time here. I came across this board and I to find It really useful & it helped me out a lot. I am hoping to provide one thing back and aid others like you helped me.
Feel free to visit my website :: online herrenschuhe

9. This is a great tip especially to those new to the blogosphere.

Short but very accurate info… Thank you for sharing
this one. A must read article!

Also visit my web-site kfz kredit
Here is my site -

10. I am sure this post has touched all the internet visitors, its really really
fastidious piece of writing on building up new weblog.
My web-site :: can i get a home equity loan with bad credit

11. Thank you for sharing your thoughts. I truly appreciate your efforts
and I will be waiting for your further write ups thank you once again.
Check out my web page ... google website Seo

12. Very energetic post, I enjoyed that a lot. Will
there be a part 2?
Also see my website - schnelle kredite ohne schufa

13. What's Happening i am new to this, I stumbled upon this I have found It positively useful and it has helped me out loads. I'm hoping to
give a contribution & aid different users like
its aided me. Good job.
My weblog ; krankenversicherung Hunde vergleich

14. I comment when I especially enjoy a article on a site or I have something to add to the conversation.
It is a result of the fire communicated in the post I browsed.
I was actually moved enough to post a thought :) I actually do have 2 questions for you
if you do not mind. Is it just me or do some of these responses look as if they are left by brain dead
folks? :-P And, if you are posting on additional online
Also visit my web-site ; home based businesses

15. hi!,I like your writing very a lot! percentage we communicate extra
about your post on AOL? I require a specialist on this house to solve my problem.
May be that's you! Looking ahead to peer you.
Also see my web page :: vergleich private krankenversicherung beamte

16. I just like the valuable information you provide on your articles.
I'll bookmark your blog and take a look at once more here frequently. I'm rather certain I'll learn a lot of new stuff right right here! Best of luck for the following!
My blog post ... online jobs at home

17. You're so awesome! I don't suppose I've read through a single thing like this before. So nice to find someone with some genuine thoughts on this subject matter. Seriously.. thank you for starting this up. This website is one thing that is required on the web, someone with a bit of originality!
Review my web site :: Credit Union Private Student Loan Consolidation

18. I'm truly enjoying the design and layout of your site. It's a
very easy on the eyes which makes it much more enjoyable for me to come here and
visit more often. Did you hire out a designer to create your theme?

Superb work!
Also see my website > best Webhost

19. Hi! I know this is kind of off-topic however I had to ask.
Does building a well-established blog such as yours require a large amount of
work? I'm completely new to writing a blog but I do write in my journal daily. I'd like
to start a blog so I can share my own experience and
thoughts online. Please let me know if you have any recommendations
or tips for brand new aspiring blog owners. Thankyou!
My webpage ; ratgeber private krankenversicherung

20. My brother suggested I would possibly like this web site.

He used to be totally right. This publish
truly made my day. You cann't believe simply how so much time I had spent for this info! Thanks!
Visit my web blog ... Understanding home equity loans

21. Hi there, i read your blog occasionally and i own a similar one and
i was just curious if you get a lot of spam comments?
If so how do you stop it, any plugin or anything you can advise?
I get so much lately it's driving me mad so any assistance is very much appreciated.

my webpage ... http://elearn.mgimo.ru/user/view.php?id=6321&course=1
Feel free to visit my blog ... payday loans online

Thank you for sharing!

Feel free to surf to my homepage Bonuses
Feel free to surf my page ... http://forum.cm77.com/index.php?do=/blog/10977/fashion-and-style-suggestions-to-live-by/

23. I drop a comment each time I like a article on a site or I have something to valuable to contribute to the discussion.

Usually it is triggered by the sincerness displayed in the
article I looked at. And after this post "Arithmetic Expression Evaluation".
I was actually moved enough to post a thought ;
) I do have a couple of questions for you if you do not mind.
Could it be simply me or does it seem like a few of the remarks appear
like they are written by brain dead individuals? :-P And, if
you are posting at additional social sites, I'd like to keep up with everything new you have to post. Could you make a list the complete urls of all your shared pages like your linkedin profile, Facebook page or twitter feed?

Here is my web site: please click the next website page

24. These are in fact impressive ideas in regarding blogging.
You have touched some pleasant factors here. Any way keep up
wrinting.

Feel free to visit my blog; http://www.mi.hs-heilbronn.de/gmds-cbt/index.php?title=Benutzer:Arnoldo40

25. you're in point of fact a just right webmaster. The site loading speed is amazing. It kind of feels that you're doing any distinctive trick.
Also, The contents are masterwork. you've performed a fantastic activity in this matter!

Have a look at my page Adult All Inclusive resorts

26. It's enormous that you are getting ideas from this paragraph as well as from our dialogue made here.

Also visit my blog: Home

27. Greetings from Colorado! I'm bored to tears at work so I decided to check out your site on my iphone during lunch break. I love the information you provide here and can't wait to take a look
when I get home. I'm shocked at how fast your blog loaded on my cell phone .. I'm not even using WIFI,
just 3G .. Anyhow, excellent blog!

My website - best affiliate program

28. Hi there, I think your blog could possibly be having internet
browser compatibility issues. When I look at your web site in Safari, it looks fine however when opening in Internet Explorer, it has some overlapping issues.
I just wanted to provide you with a quick heads up! Besides that, excellent website!

My web site: ratenzahlung trotz schufa

A theme like yours with a few simple adjustements would really make my blog jump out.

Here is my web blog :: Raspberry ketone reviews

30. I blog frequently and I seriously appreciate your information.
This great article has truly peaked my interest. I am going
to book mark your website and keep checking for new information about once per week.

My web site: pkv für studenten

31. Wow, marvelous blog layout! How long have you been blogging for?
you made blogging look easy. The overall look of your site is great, let alone the content!

Also visit my blog :: diets that work

32. The report hаs provеn beneficial to me persοnallу.

It’s extremеlу informativе and you're simply obviously really knowledgeable in this region. You have opened my own eyes for you to varying views on this particular matter together with intriguing and solid articles.

Check out my blog phentermine
Stop by my page ; buy phentermine

33. Greetings from Colorado! I'm bored at work so I decided to check out your site on my iphone during lunch break. I really like the info you present here and can't wait to take a look when I get home.
I'm surprised at how fast your blog loaded on my mobile .. I'm not even using WIFI,
just 3G .. Anyhow, wonderful blog!