CS 2223 Apr 02 2018
Expected reading:
Daily Exercise:
Classical selection:
Bach: Goldberg Variations (Glenn Gould) (1741)
Musical Selection:
U2: With or Without You (1987)
There are no secrets to success. It is the result of preparation, hard work learning from failure.
General Colin Powell
1 Preparing for Exam 1
1.1 HW2 grades completed
Grades are now complete for HW2. You can retrieve feedback later today: Not all of the excel documents have been uploaded by the graders.
Statistics show the average was 71 (median: 83), compared to average of 92.6 (median: 98.5) on HW1. Discussion ensues.
1.2 Start with question
An array of N integers is defined to have a dominant value if that value is duplicated more than N/2 times in the array. Thus [1, 2, 3, 4, 5, 6] has no dominant value, but 2 is the dominant value for the array [1, 2, 1, 2, 2]. Note that this definition holds when N is either even or odd.
Design algorithm to solve this problem
Then determine its running time by computing a Tilde approximation based on the size of the array, N.
Note: This problem requires more time to think about than granted on an exam. But it makes for a nice discussion point.
1.3 Fundamental Concepts
Brief review of the first half of this course, and fundamentals we have been practicing.
1.4 Divide and Conquer Recurrences
You have seen these in lecture a number of times. They appear, for example, as follows:
Entire Lecture Mar 26 2018
Daily Exercise, Mar 23 2018
QuickSort (p. 293)
MergeSort (p. 272)
Dominance (today’s lecture)
1.5 Alternate Question Revisited
A researcher proposes to design a data type which consiststs of a linear linked list of nodes, each of which stores an array of K individual comparable items in sorted order. This data type will offer the following operations:
insert (v) – insert v into the collection
remove (v) – remove v from the collection
contains(v) – check whether collection contains v
So we know the time for contains is not ~ log(N*K); but what is the worst case for this algorithm?
We will discuss. Code will be made available, together with performance results.
1.6 Exam 1 Tomorrow
Exams are closed-book, closed-notes. You may bring in one sheet of notes (one paper, 8.5" x 11.5", both sides) to each exam. You may not use any computers, calculators, cellphones, headphones, or other electronic devices during the exams.
There are no makeups for exams. Absence from an exam will be excused only for medical or emergency reasons. A note from your doctor or from the Office of Academic Advising will be required. In such cases, your final grade will be recorded as Incomplete and you will be allowed to take a makeup exam once the course is over.
1.7 Version : 2018/04/03
(c) 2018, George Heineman