Grace Hopper Center

CSC 223 Weekly Assignments: Week 12

CSC 223


Overview

Friday and Monday, May 1st and 4th

Plans

At long last, the promised source file listings, SORT.H and SORTTEST.C are ready.

You will not be allowed to use notes on the test on Chapter 14: Searching and Sorting, but you will be given a printed version of these two documents to use during the test.

Please study the sort algorithms as presented in SORT.H, the unit tests in SORTTEST.C, and the presentation of these sorting algorithms in Chapter 14: Searching and Sorting in our text.

The following students will present and explain the following sorts:

Sorting Algorithms
SortPresenters SortPresenters
Bubble SortAbi (1A) / Noah (3B) Merge SortAlex (1A) / Conrad (3B)
Insertion SortRockwell (1A) / Gabe (3B) Quick SortGabriel (1A) / Toby (3B)
Selection SortEleanor (1A) / Anupama (3B) Radix SortNikita (1A) / Donovan (3B)
Heap SortSean (1A) / Blu (3B) Tree SortJeff (1A) / Dylan and Alessandra (3B)

Presentations will be given in class on Tuesday and Wednesday of next week, with the test following on Thursday and Friday and will be evaluated using the following rubric:

Grade Description
A You provide a clear explaination of the algorithm with example data on which you trace the algorithm step-by-step and you identify all of the questions in the exercises at the end of Chapter 14 that relate to your sort, and provide their solutions.
B You provide an explaination of the algorithm with a trace, but you are not clear enough in your presentation to earn an A. You identify some but not all of the end of chapter exercises related to your algorithm.
C You convince me that you understand how your algorithm works, but you don't provide a trace example. A C will also be the best score you can earn if you don't provide end of chapter exercises.
D You can demonstrate some understanding of how your algorithm works.
E Missing in action.

Alternative Evaluation for Brendan

I've been working out an alternative evaluation for Brendan, but just to make it transparent I'll state it here (and I've added two new requirements):

  1. Expand our BDSCTEST.H testing tool to support adding strings to the ASSERT functions for identifying which assertions failed.
  2. Write a new ASSERT_ARRAY_EQUAL(expected, actual, n) macro that can be used to check if two arrays are equal.
  3. Write a new ASSERT_ARRAY_INCREASING(arr, n) and ASSERT_ARRAY_DECREASING(arr, n) macros.

Wednesday and Thursday, April 29th and 30th

Plans

Most of the students in section 3B are away the rest of this week, so we'll use class Wednesday in section 1A to test our set up of the AltairZ80 CP/M environment.

Monday and Tuesday, April 27th and 28th

Classwork

I spent way more time than I had refactoring the sorting algorithms that Jake aggregated into versions that closely align with the presentations given in our text. I finished bubble_sort, insertion_sort, selection_sort, merge_sort, quick_sort, and my favorite, heap_sort.

I also added a set of unit tests for the helper functions used by several of the sorts. During class today, folks who were responsible for the sorts I have completed with present my versions to the class, along with a detailed explaination for how they work.

Students responsible for radix_sort, shell_sort, and tree_sort will have class time to modify the the version they submitted so that:

  1. it matches as closely as possible the presentation in our text.
  2. it will work as a drop-in replacement for the versions I have commented out in SORT.H.

You should start by downloading SORT.H and SORTTEST.C (both of which are available here), and compiling and running the tests. Then comment out the tests for all sorts but the one you are working on and proceed from there.

Homework / Evaluation

You will be evaluated based on a modified version of the rubric from week 9. I want to note that this rubric stated that You implement your selected algorithm as presented in our text, though almost none of you did this. I spent hours fixing that error for most of the sorts, and I'll give those of you assigned the sorts I did not get to fix another chance to fix them yourselves.

For those of you whose algorithms I did fix, my need to do that will cost you a letter grade.

For homework, please study these algorithms closely and reread the chapter in our text to prepare for the test.