Computer Science 483 Department of Computer Science
Data Structures and Analysis of Algorithms George Mason University
R. Paul Wiegand Spring 2006

[syllabus]  [course schedule]  [assignments]

CS 483 Assignments web page


Homework problems
(The problems in red are the ones I highlighted in class)

Chapter 1:
Chapter 2:
Chapter 3:

Chapter 4:
Chapter 5:
Chapter 6:
Chapter 7:
Chapter 8:

Chapter 9:
Chapter 10:
Chapter 11:
  • Section 11.1: Problems 4 and 5
  • Section 11.2: Problems 5 and 9
  • Section 11.3: Problems 1, 3, and 5
(*) Challenge problems


Project assignments

Project I: Analyzing Sorts

Write a paper comparing and contrasting BubbleSort, MergeSort, and ShellSort. Discuss the advantages and disadvantages of each in the context of efficiency of computational running-time with respect to input size. For BubbleSort, include a proof of correctness for the algorithm.

In addition, implement the three algorithms and conduct an empirical analysis. Describe how you chose to measure input size and running times, including your motivation for those choices. Be as clear and detailed as possible about all of these choices. For example, if you choose to count operations, explain which operation you will be counting and why. Additionally, the report should contain graphs and/or tables of input size versus running time and a discussion for how the data matches the formal running time.

Submit the project electronically by sending me an email message with attached gzipped tar file.
The tarball should include:
  • The report in text, PS, PDF, HTML, or RTF format (do NOT send me a Word document);
  • Any graphs non-embedded graphics in non-proprietary formats such as PS, JPEG, PNG, etc. (do NOT send me an Excel spreadsheet);
  • Source code, but not binaries;
  • Notes for compiling the sources, if necessary;
  • Any relevant data files.
Languages:
You may use gcc (version 3.9x or greater), g++ (version 3.9x or greater), or Java (JDK 1.4.x or greater) for a programming language. If you prefer to use another language, talk to me about it. My only strong opinion is that I should be able to compile it with a freely accessible compiler.

The project will be due by midnight March 8.





Project II: Balanced Trees

Write a paper comparing and contrasting AVL trees, 2-3 trees, RED-BLACK trees, and SPLAY trees. Discuss the advantages and disadvantages of each in the context of computational running-time and memory requirements with respect to input size for the Search, Insert, and Delete operations.

Choose any two of the above data structures and implement them. The programs should take in two flat files of integer key values, such that each key is on a separate line. The names of the files should be specifiable at the command line. The program should use the first file to build the tree via repeated insertions, and the second to query the tree via repeated calls to the search procedure. You do not have to implement the Delete operation. Count all key comparisons associated with a given operation and output the following two statistics for each one: the current size of the tree and the number of key comparisons required.

A program to produce random data sets will be provided to you. Run your programs on 20 pairs of randomly generated data sets of different sizes. Produce 4 graphs: 1 for Insert and 1 for Search, for each tree. Each graph should have tree size on its x-axis and average number of comparisons on the y-axis. Include the graphs in your paper, as well as a discussion of how the empirical curves relate to the analytical complexity. Suggest an analytical curve for each of your four empirical plots, including any constants that may improve the fit. If you can, overlay these curves on your four empirical plots for visual comparison. Compare and constrast this emprical analysis of the two data structures.

RED-BLACK and SPLAY trees are not discussed the Levetin text, so you must research this data structure elsewhere. All resources used must be cited. Follow the language and submission instructions for project 1.

I have provided some basic code that you may use as you see fit to help you with this assignment. You are not obligated to use any of it. I intend the code to be a starting point for the assignment; however, I make no guarantees about the code -- you are responsible for debugging your own code, regardless of the state of the code you receive from me.

  • cRandProc -- C++ source for generating random numbers
  • cBinTree -- C++ source for a simple binary tree
  • jBinTree -- Java source for a simple binary tree

The project will be due by midnight Friday, April 7.





Project III: Computational Difficulty

Choose a known NP-Complete problem and write a paper about that problem. Your choice cannot include any of the problems disucssed in the book or in the "Examples" section of the Wikipedia entry for "NP-Complete". Use your own words and cite all materials referenced.

The report should include a relatively detailed description of the problem and a discussion of at least one reduction demonstrating that it is NP-Complete. Explain why the problem is difficult, as well as your position on why the problem is important. The paper should also describe (in English) an algorithm for finding complete solutions to the problem, as well as a known approximation method for approaching the problem. Be specific.

There is no programming component to this project

The project will be due by midnight Friday, May 5.