Learn how to use parse trees to evaluate mathematical expressions, and how to use sorted trees.
by Rod Stephens
June 5, 2008
he first part of this series explained basic tree terminology and showed how to build a simple binary tree in Visual Basic
or C#. It also explained how to perform traversals of trees but the only really practical application it showed was how to make a
tree draw itself. That’s pretty handy if you need to display a tree, but trees can do so much more.
This article explains a few more practical uses for trees. First, it explains how to use a tree to parse arithmetic
expressions. It then discusses sorted trees and shows how to use a sorted tree to build a simple animal guessing game.
It's quick, easy and you get access to all the articles on DevX.
This registration/login is to allow you to read articles on devx.com. Already a member?
To become a member of DevX.com create your Member Profile by completing the form below. Membership is free!