SE701:Formula tree evaluation: Difference between revisions

From Marks Wiki
Jump to navigation Jump to search
New page: == Formula Tree Evaluation == Idea is simple. Get user to input a formula with numbers and operators and brackets (I'll leave algebra out of it for now). Then evaluate the formula. Easy. ...
 
(No difference)

Latest revision as of 20:19, 15 February 2008

Formula Tree Evaluation

Idea is simple. Get user to input a formula with numbers and operators and brackets (I'll leave algebra out of it for now). Then evaluate the formula. Easy.

Probably best done by parsing the expression into some sort of expression tree.

e.g.

(3+4)*5+7*8/2+1

becomes

             +
        +        1
    *       /
  +   5   *   2
 3 4     7 8