fullscreen
timer
qrcode
plickers
selector
edit
reset

Introduction

COS 320 - Algorithm Design

disclaimer





This course is based on the COS 423 Princeton course.

These slides are based heavily on Kevin Wayne's slide material.

(as in Sedgewick and Wayne of COS 265 Algorithms book)

help!

At the end of the term, you will fill out an evaluation.

Please be critical, letting me know what worked and what did not.

Read the assigned book readings, so I can know if they were helpful.

Algorithm Definitions

A procedure for solving a mathematical problem (as of finding the greatest common divisor) in a finite number of steps that frequently involves repetition of an operation.
–webster.com


An algorithm is a finite, definite, effective procedure, with some input and some output.
–Donald Knuth

algorithm etymology

Etymology

[ Knuth, TAOCP, Wikipedia ]

cos 265 vs. cos 320

COS 265: Data Structures and Algorithms

private static void sort(double[] a, int lo, int hi) {
    if(hi <= lo) return;
    int lt = lo, gt = hi;
    int i = lo;
    while(i <= gt) {
        if     (a[i] < a[lo]) exch(a, lt++, i++);
        else if(a[i] > a[lo]) exch(a, i, gt--);
        else                  i++;
    }
    sort(a, lo, lt-1);
    sort(a, gt+1, hi);
}

cos 265 vs. cos 320

COS 320: Algorithm Design

\[\begin{array}{rcl} \sum_{i=1}^n \sum_{j=i+1}^n \frac{2}{j-i-1} & = & 2 \sum_{i=1}^n \sum_{j=2}^{n-i+1} \frac{1}{j} \\ & \le & 2n \sum_{j=1}^n \frac{1}{j} \\ & \sim & 2n \int_{x=1}^n \frac{1}{x} dx \\ & = & 2n \ln n \end{array}\]

why study algorithms?


We emphasize algorithms and techniques that are useful in practice

big idea



My main objective: help students to learn how to...

Administrative stuff

computer use

Mounting research indicates that electronics usage in classroom harms student's ability to retain and process information.

For example, although students that take notes using laptops tended to record more information, follow-up tests show that they processed and retained much less than those that take notes on paper.

Therefore, I have adopted a no-computer-use policy.

During lecture time, you are not allowed to use a computer, even for taking notes.

Exception may be granted to those that write a 1-page argument.

See syllabus and course Brightspace page for details.

resources

You will need to refer to these resources frequently:

slides

The slides are provided in interactive format using HTML

They have been tested to run and look OK in Google Chrome and mostly OK in Firefox

There may be bugs. Let me know, and I will fix them.

assessment and expectations

Assessment will fall in these categories:

assessment and expectations

General participation:

assessment and expectations

Solving problem assignments:

Generally, I will post these assignments while we are still covering the needed materials, so that you can:

assessment and expectations

Crafting problem assignments:

assessment and expectations

Coding problem assignments:


Programming Competition assignment(s):

collaboration

See syllabus for full details; ask if unsure; never assume.


If assignment is marked "Collaboration Permitted", you...

If assignment is marked "No Collaboration", you...

grading

For COS 320 (and many others I teach), I use a 3pt grading system.

Each gradeable item is scored 0–3 (or a scaled version). Assignments will have many gradeable items.

0 nothing of value was submitted F
1 submitted, but clearly not correct D-
2 not a 0, 1, or 3 C
3 perfect solution, meets every
requirement and expectation
A

Submitting nothing is clearly a 0, but also submissions that contain very little actual work will receive a 0.

Submissions that are missing significant portions or produce incorrect or unexpected output will likely get a 1.

See my student page for break-down

template

template with formatting and without formatting

×