CSE326
Summer 2004
Assignment 5
7/15/2004

Data Structures: Live!

Due in two parts: Electronic parts on Wednesday, July 21 and 28, paperwork in class the following days.

Please work with the same parter as for the previous project.  Turn in only one copy, and put both partner's name on the paper.  Both will receive the same grade under normal circumstance.  ({S We will be shuffling partners after this assignment).

Remenber this? "Read carefully through 4.39-4.40.  Think about each step and how you would program it.  Will be the basis of a future project..."

The future is now!  Write Java code along the lines suggested by those problems.  Specifically:

Part I:
The goal of the first week is to get a binary tree structure that you can display and perform basic operations on.

Create a class Node.java to implement the interface INode.java, and DrawableNode.java which implements IDrawableNode.   Also, write test code which creates trees and displays.  How this fits together will become gradually clearer after you look at the interfaces.  In particular, the drawing code itself will be in the draw method of IDrawableNode.  If you are new to Java graphics, feel free to get as much help as you need from Martin and Deepak or from your classmates.  You can focus on using the basic drawing facilities provided in classes such as Graphics, Shape classes such as Line, Rectangle, etc.  You won't have to worry about events or user interface stuff.  We will give you a class which will provide a context for calling your drawing method.

During the first week, you should also be thinking ahead to the work of Part II.

Part II:
The goal this week is to use your tree-drawing  code as the basis for an interesting "animation".  An animation is a sequence of images intended to illustrate some algorithm or process.  Here are some examples (you can use one, or even better, think of something of real interest to you that problably no one else will pick!  Maybe we'll have a prize for the best "concept".  Let your imagination rule.):
In doing this, you might want or need to show more than just circles for nodes and straight lines for edges.  You can make any data structure you wish the focus on the animation, though it might be best to choose one we have studied this quarter, or which is similar to one of those.  Note that the INode interface is general enough to allow structures other than binary trees, such as lists, multiway trees, and graphs.  And of course your concrete subsclasses can build on INode in many possible ways.

To control your animation, you may need some data structure (who knows what? a list of actions or of parts of trees or ...? etc.) 

Finally, there should be some way for a user to interact with the animation, to supply data before or during the display, or make choices, specify parameters, etc.  This does not have to be done with an elaborate GUI.  Anything at all is fine, even if it's a bit clunky.

The exact code you turn in will vary from team to team.  The way the projects will operate will vary, too.   There will be an electronic code turn-in as usual, as well as written reports.  In addition, expect there to be a live demo session, at which the team members will demonstrate their project to Martin and/or Deepak.  These sessions will be scheduled after the final turn-in.

First week Deliverables:

Second Week Deliverables:
Have fun!