SE701:Formula tree evaluation

From Marks Wiki
Revision as of 20:19, 15 February 2008 by Mark (talk | contribs) (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. ...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

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