Programming Assignment 1

Algorithm Animation

Data Structures & Algorithms Fall 2009


Due Date

This assignment is due by 9:00 p.m. on Thursday, 15 October.

See the assignment turn-in page (last modified on 22 September 2009) for instructions on turning in your assignment.

The absolute deadline for turning-in Assignment 1 is Friday, 16 October at 9:00 p.m.. It is not possible to turn-in Assignment 1 after the absolute deadline.

Background

Samba is an animation system that reads drawing commands from std-in, executes them, and displays the result in a window.

The file samba.txt in the assignment directory /export/home/class/cs-305-503/a1 contains the Samba documentation. The Samba executable samba is in the same directory. The tar file samba.tar.bz2 in the same directory contains the source for Samba (and Polka, on which Samba is built) if you want to build Samba locally. There is a version of Samba that runs on Microsoft systems, but it's old (1997 vintage).

The Problem

Select one of the programming projects given in Chapters 4 (pages 176–177) or 5 (pages 248–249), implement it, and annotate it with print statements that produce an animation of the algorithm's execution when run through Samba. E-mail me (rclayton@monmouth.edu) your problem choice so I can make sure there are no duplicates; problem selection is first-come, first-serve.

Input

To keep things simple, your program should generate problem instances internally without need for any input. For example, if animating problem 5.5, your solution would randomly pick a number between 1 and 20 (for example) to use as the number of people in the circle.

Output

Your program should animate its execution on the generated problem instance by writing Samba commands to std-out.

Implementation

Your code should have minimal or no dependence on the Java library classes. Your classes may implement Java library interfaces, although that can get involved for the more complicated interfaces. You can also use the Java library interfaces as a model for simpler interfaces you develop and then implement. Your data structures should be generic.


This page last modified on 24 September 2009.