Mid-Term 1: Coverage

·         Next Wednesday (10/23)

·         Open book: focus on understanding!

o    OK to consult your own notes on devices

o    ABSOLUTELY no on-line access. BE HONEST!

Coverage:

·         Textbook:

o    Chapters 1 (to end of 1.3),

o    Chapter 2,

o    Chapter 5 (5.3: Understand what/why backtracking)

o    Chapter 10 (ignore link list example: one of them)

·         Lecture notes: all except

o    Lecture 4: did not cover fractals (read for fun)

o   Lecture 7: did not cover Master's Theorem (know it is there, not for this class)

·         In-class examples: follow the link and make sure you understand all examples here.

·         Nuances from HW1, HW2, and HW3 (to come)

C++ Knowledge: (Cut/Paste from end of lectures notes 2 & 3 above):

See the C++ notes linked on the course web site: http://courses.washington.edu/css342/zander/css332/

In particular, the following pages (Lecture 2):

 

 

When discussing abstraction and data hiding (Lecture 3), we talked about:

 

 

 

We discussed Templates: In many cases, we would like to write a function so that it would apply to many different classes of objects. Examples include min(a, b) , swap(a, b) or sort(array, n). Here is a simple example of min:

                template <typename Comparable>     

      Comparable min(Comparable a, Comparable b) {

            if (a < b) return a;

            else return b;

      }

or

                template <typename Comparable>

      const Comparable &min(const Comparable &a, const Comparable &b) {

            if (a < b) return a;

            else return b;

      }

 

See the Complex number class on the course website for a template class example:

o   Complex.h

o   Complex.cpp

o   ComplexDriver.cpp