PROGRAM #2

Fall 2008

Due: October 17, 2008, 5pm on eLearning


General Guidelines:


There are two problems in this project:

PROBLEM#1    Maximum subsequence sum problem:

(40 points)

For this assignment you will be implementing the four different solutions we discussed in class for the maximum subsequence sum problem, and comparing them for performance. Here are the details:

            Your curves in each plot should obviously say which curve stands for which algorithm (using legends). You must use some electronic tool (e.g., matlab, gnuplot, excel) to create the plot - handwritten plots will NOT be accepted.

Report for problem 1:

In a separate document (Word or PDF), compile the following sections:

·        A: Problem statement. In a couple of sentences state the goal(s) of this exercise.

·        C: Experimental Results:  In this section, include the following:

o       The plots from the above test results

o       Answer this question in not more than 5 lines: Are the observations made in the above plots as per your expectations? If so, why, and if not, why not?   

What you need to submit:

In one zip file called "MaxSubSum<YourLastName>.zip", compress the following:

  1. A separate folder containing all your source code (including the main function you used for testing)
  2. The Report

PROBLEM #2    A simple board game:

(60 points)

For this assignment, you will be implementing a simple board game using an appropriate tree data structure of your choice. A "board" is defined as a m x m square matrix, with each cell identified using a unique (x,y) coordinate. An example 10 x 10 board is shown in the figure below. In a game, a board has n players, each illustrated in the figure as a queen piece (from a chessboard). Note that n should less than or equal or m x m. The figure shown below is for m=10 and n=8.

Your task is to implement the following functionalities:

You should make the best choice possible for the container data structure(s) that will store all the players of a board along with their positions. Your decision should be based on what can guarantee the desired performance for each of these methods. 

Hint: Note that PrintByCoordinate requires traversing the set of players in order of their x-coordinates. But other methods require traversing the set of players in the order of their IDs. So, think about maintaining the set of players in two separate data structures: once in a structure ordered by ID and once in a structure ordered by x-coordinates. Of course, this design would imply that you need to update both structures every time there is an update.

Report for problem 2:

In a separate document (Word or PDF), compile the following sections:

·        A: Problem statement. In a couple of sentences state the goal(s) of this exercise.

·        C: Algorithm design. Within one page, provide a brief description of the main ideas behind your implementation. Add a high level description (in plain English) behind each method’s implementation (basically what data structure it uses and what run-time complexity that method will take). Add a figure to illustrate the design, if possible.

What you need to submit:

In one zip file called "BoardGame<YourLastName>.zip", compress the following:

  1. A separate folder containing all your source code (including the main function you used for testing)
  2. The Report

FINAL CHECKLIST FOR SUBMISSION:

    ___  Cover sheet

    ___  MaxSubSum<YourLastName>.zip

    ___  BoardGame<YourLastName>.zip

    ___  Both the above zipped into another folder archive called Program2<YourLastName>.zip