Fall 2017

Note: Homework will be assigned regularly. I will try to keep this page up to date, but homework should otherwise be announced in class. If you miss class and the day's homework has not been posted, please make sure to contact your professor so you don't miss anything.
## Note About Assignments: Creating Better Looking Documents: Typesetting with LaTeX and graphvizIt is my very strong recommendation that you start working on assignments in the lab in order to get comfortable with their use before attempting your own install. |

## Homework Assignments## Homework 1:Chapter 1.1: 1.1-1 through 1.1-5Chapter 1.2: 1.2-1 through 1.2-3Assigned: 08/29Due: 09/05## Homework 2:Chapter 2.1: 2.1-1 through 2.1-4Assigned: 08/31Due: 09/07## Homework 3:Chapter 2.2: 2.2-1 through 2.2-3Assigned: 09/05Due: 09/12## Homework 4:Chapter 2.3: Exercises 2.3-3 through 2.3-6, Problems 2-1ab, 2-2abcdAssigned: 09/20Due: 10/01 (via github)## Homework 5:Chapter 3.1: Exercises 3.1-1 through 3.1-4, 3.1-6 and 3.1-7Chapter 3.2: Exercises 3.2-1 through 3.2-3, 3.2-6, Problems 3-1, 3-2, 3-4Assigned: 09/28Due: 10/05 (via github)## Homework 6:Chapter 4.1: Exercises 4.1-1, 4.1-2, 4.1-4Chapter 4.3: Exercises 4.3-1 through 4.3-3Chapter 4.5: Exercises 4.5-1 through 4.5-3 note:
- Please use the substitution method from class to derive a Θ bound.
- Show all your work. You don't need to
*prove*the bound, just derive it.
Non-Chapter: Use the tabular method to solve
- Try g(n) = 1 - f(n).
Assigned: 10/13Due: 10/22 (via github)## Homework 7:Chapter 6.1: Exercises 1-1, 1-3 through 1-5Chapter 6.2: Exercises 2-1, 2-3, 2-6Chapter 6.3: Exercises 3-3Chapter 6.4: Exercises 4-2Assigned: 10/27Due: 11/06 (via github)## Homework 8:Chapter 7.1: Exercises 1-3Chapter 7.2: Exercises 2-1 through 2-4Chapter 7.3: Exercises 3-1, 3-2Chapter 7.4: Exercises 4-2, 4-5Assigned: 11/10Due: 11/17 (via github) |
## Programming Assignments## Program 1: Insertion and Merge SortGoals:Implement the text's algorithm for Insertion Sort. Implement the text's algorithm for Merge Sort. Compile the results of experimentation in a spreadsheet. Describe the results of your experimentation in a text file. First, in your repo create the following directory structure: **sort****insertion**- implementation files/test scripts here**test**- output of trials here
**merge**- implementation files/test scripts here**test**- output of trials here
- Your implementations for insertion and merge sort should both take a command line parameter
*n*. Your program should then randomly generate*n*integers in the range 0..1000. - Each test should have a single associated script with an obvious name (so that I only have to run one thing to get results).
- The only output on the terminal should be the times of each test (as reported by /usr/bin/time).
- The original array and the sorted array should be outputted to standard out, which should then be redirected into a file in the
**test**directory. - You should have tests of both algorithms under the following circumstances: ordered data, reversed data, random data.
- You can encode the 6 tests as separate scripts/binaries, or as a single one that is capable of doing all tests (as long as it is only performing one test per run so the output of /usr/bin/time is accurate).
- A sample bash script that expects a program called insertion_sort.py, a directory called test where it outputs the results of the tests, and invokes /usr/bin/time to report test results. (Files like this should be located in
**insertion**and**merge**directories.) Run with`bash filename.bash`. - A sample spreadsheet to organize your results. (Please put in the
**sort**directory.) - A sample report on your results (Please put in the
**sort**directory.)
Assigned: 09/07Due: 09/17 at 11:59 p.m.## Program 2Building on the previous results, add new directories, source files, and tests for the following algorithms:- selection sort
- bubble sort
- Add a new report: report2.txt (or pdf).
- Augment your previous spreadsheet to accommodate the new results. Have at least one graphic that compares the four sorting algorithms directly (pick the most reasonable test results per search algorithm).
- Add a new toplevel directory called max to store your results.
- Add new test cases where
*n*random values are timed for various values of*n*. (Experiment to determine the range/step for yourself.) - Include a new spreadsheet in this directory documenting your results as well as a new report.
Assigned: 09/28Due: 10/11## Program 3Implement the text's algorithm for Heapsort, Quicksort, and (randomized) Quicksort.Add them to your xlsx sheets (try to consolidate into one file for sorting), and add a new report. Draw a conclusion about the best sorting algorithms so far. Assigned: 10/27Due: 11/10## Program 4 (Optional)Implement the text's algorithm for Counting Sort.If you choose to implement Counting Sort, please update your excel report, and add it to your sorting directory as you otherwise would.If your submission is satisfactory you will earn +3 points on your lowest programming assignment grade.Assigned: 12/01Due: TBA## Program 5 (Optional)Implement DPLL. Your submission will take two forms:- Submit your code in your repo in a new "search" directory.
- Verify your code here.
Note: Your work should be your own. The above link's plagiarism detection is quite good. Please don't test this. Assigned: 12/01Due: TBA |