Expression Tree

Goals

The purpose of this assignment is to learn to

  1. Learn to use tree structures using BRIDGES
  2. Build an expression tree using the BRIDGES TreeElement class
  3. Style the tree nodes and links.

You will generate a visualization of the tree that looks like this

Programming part

Task

Getting Started

  1. Open your scaffolded code.
  2. Plug in your credentials.
  3. Review the Tree tutorial here
  4. Create Tree elements to represent the expression sqrt(ax^2 + by + cz)
  5. You will create the tree manually by creating a node for each of the elements in the expression.
  6. Style the tree using different colors for the operands and operators, adjust thickness of links, or even shapes of the nodes.
  7. Compile, run, and visualize and you should see the output above. You can use the key 'l' to display the lables, or mouse over the nodes.

Help

for Java

Tree Element Documentation

ElementVisualizer documentation

LinkVisualizer documentation

for C++

Tree Element Documentation

ElementVisualizer documentation

LinkVisualizer documentation

for Python

Tree Element Documentation

ElementVisualizer documentation

LinkVisualizer documentation