0% found this document useful (0 votes)
52 views7 pages

00intro 2x2 PDF

This document provides an overview of the COS 226 course at Princeton University. It discusses the topics that will be covered, including algorithms, data structures, sorting, searching, graphs and strings. It also outlines the course structure, including lectures, precepts, assignments and exams.

Uploaded by

Aisha Arif
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
52 views7 pages

00intro 2x2 PDF

This document provides an overview of the COS 226 course at Princeton University. It discusses the topics that will be covered, including algorithms, data structures, sorting, searching, graphs and strings. It also outlines the course structure, including lectures, precepts, assignments and exams.

Uploaded by

Aisha Arif
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

COS 226 course overview

COS 226, SPRING 2014

What is COS 226?

Intermediate-level survey course.


Programming and problem solving, with applications.
Algorithm: method for solving a problem.
Data structure: method to store information.

ALGORITHMS
AND

DATA STRUCTURES
KEVIN WAYNE

topic

data structures and algorithms

data types

stack, queue, bag, union-find, priority queue

sorting

quicksort, mergesort, heapsort, radix sorts

searching

BST, red-black BST, hash table

graphs

BFS, DFS, Prim, Kruskal, Dijkstra

strings

KMP, regular expressions, tries, data compression

advanced

B-tree, k-d tree, suffix array, maxflow

http://www.princeton.edu/~cos226
2

Why study algorithms?

Why study algorithms?

Their impact is broad and far-reaching.

Their impact is broad and far-reaching.

Internet. Web search, packet routing, distributed file sharing, ...


Biology. Human genome project, protein folding,
Computers. Circuit layout, file system, compilers,
Computer graphics. Movies, video games, virtual reality,
Security. Cell phones, e-commerce, voting machines,
Multimedia. MP3, JPG, DivX, HDTV, face recognition,
Social networks. Recommendations, news feeds, advertisements,
Physics. N-body simulation, particle collision simulation,

Why study algorithms?

Why study algorithms?

Old roots, new opportunities.

For intellectual stimulation.

Study of algorithms dates at least to Euclid.


Formalized by Church and Turing in 1930s.
Some important algorithms were discovered

FRO M THE
EDITORS

THE JOY OF ALGORITHMS

For me, great algorithms are the poetry of computation. Just

Francis Sullivan, Associate Editor-in-Chief

like verse, they can be terse, allusive, dense, and even mysterious.

by undergraduates in a course like this!

But once unlocked, they cast a brilliant new light on some


aspect of computing.

Francis Sullivan

mysterious. But once unlocked, they cast a brilliant new light


on some aspect of computing. A colleague recently claimed
that hed done only 15 minutes of productive work in his
whole life. He wasnt joking, because he was referring to the
15 minutes during which hed sketched out a fundamental optimization algorithm. He regarded the previous years of
thought and investigation as a sunk cost that might or might
not have paid off.
Researchers have cracked many hard problems since 1 January 1900, but we are passing some even harder ones on to the
next century. In spite of a lot of good work, the question of
how to extract information from extremely large masses of
data is still almost untouched. There are still very big challenges coming from more traditional tasks, too. For example, we need efficient methods to tell when the result of a large
floating-point calculation is likely to be correct. Think of the
way that check sums function. The added computational cost
is very small, but the added confidence in the answer is large.
Is there an analog for things such as huge, multidisciplinary
optimizations? At an even deeper level is the issue of reasonable methods for solving specific cases of impossible problems. Instances of NP-complete problems crop up in attempting to answer many practical questions. Are there
efficient ways to attack them?
I suspect that in the 21st century, things will be ripe for another revolution in our understanding of the foundations of
computational theory. Questions already arising from quantum computing and problems associated with the generation
of random numbers seem to require that we somehow tie together theories of computing, logic, and the nature of the
physical world.
The new century is not going to be very restful for us, but it
is not going to be dull either!

C O MPUTIN G IN S CIEN CE & E N GINEERIN G

Donald Knuth

2000s

1990s

1980s

1970s

1960s

1950s

1940s

1920s

1930s

An algorithm must be seen to be believed.


300 BCE

SCIENCE & ENGINEERING IS ALGORITHMS. IN FACT, WE WERE BOLD

LECTED THE TOP 10 ALGORITHMS OF THE CENTURY.

Why study algorithms?

Why study algorithms?

To become a proficient programmer.

They may unlock the secrets of life and of the universe.

I will, in fact, claim that the difference between a bad programmer

Computer models mirroring real life have become crucial for most

and a good one is whether he considers his code or his data structures

advances made in chemistry today. Today the computer is just as

more important. Bad programmers worry about the code. Good

important a tool for chemists as the test tube.

programmers worry about data structures and their relationships.

Royal Swedish Academy of Sciences

Linus Torvalds (creator of Linux)

Algorithms + Data Structures = Programs.

HE THEME OF THIS FIRST-OF-THE-CENTURY ISSUE OF COMPUTING IN

ENOUGHAND PERHAPS FOOLISH ENOUGHTO CALL THE 10 EXAMPLES WEVE SE-

Computational algorithms are probably as old as civilization.


Sumerian cuneiform, one of the most ancient written records,
consists partly of algorithm descriptions for reckoning in base
60. And I suppose we could claim that the Druid algorithm for
estimating the start of summer is embodied in Stonehenge.
(Thats really hard hardware!)
Like so many other things that technology affects, algorithms have advanced in startling and unexpected ways in the
20th centuryat least it looks that way to us now. The algorithms we chose for this issue have been essential for progress
in communications, health care, manufacturing, economics,
weather prediction, defense, and fundamental science. Conversely, progress in these areas has stimulated the search for
ever-better algorithms. I recall one late-night bull session on
the Maryland Shore when someone asked, Who first ate a
crab? After all, they dont look very appetizing. After the usual
speculations about the observed behavior of sea gulls, someone
gave what must be the right answernamely, A very hungry
person first ate a crab.
The flip side to necessity is the mother of invention is invention creates its own necessity. Our need for powerful machines always exceeds their availability. Each significant computation brings insights that suggest the next, usually much
larger, computation to be done. New algorithms are an attempt
to bridge the gap between the demand for cycles and the available supply of them. Weve become accustomed to gaining the
Moores Law factor of two every 18 months. In effect, Moores
Law changes the constant in front of the estimate of running
time as a function of problem size. Important new algorithms
do not come along every 1.5 years, but when they do, they can
change the exponent of the complexity!
For me, great algorithms are the poetry of computation.
Just like verse, they can be terse, allusive, dense, and even

(Nobel Prize in Chemistry 2013)

Niklaus Wirth

Martin Karplus, Michael Levitt, and Arieh Warshel

Why study algorithms?

Why study algorithms?

To solve problems that could not otherwise be addressed.

Everybody else is doing it.

% sort -rn PU2013-14.txt


774

COS 126

General Computer Science

615

ECO 100

Introduction to Microeconomics

471

ECO 101

Introduction to Macroeconomics

444

ENG 385

Children's Literature

440

MAT 202

Linear Algebra with Applications

414

COS 226

Algorithms and Data Structures

405

MAT 201

Multivariable Calculus

384

CHV 310

Practical Ethics

344

REL 261

Christian Ethics and Modern Society

320

PSY 101

Introduction to Psychology

300

COS 217

Introduction to Programming Systems

...

http://www.youtube.com/watch?v=ua7YlN4eL_w

10

Why study algorithms?

Why study algorithms?

For fun and profit.

Their impact is broad and far-reaching.


Old roots, new opportunities.
For intellectual stimulation.
To become a proficient programmer.
They may unlock the secrets of life and of the universe.
To solve problems that could not otherwise be addressed.
Everybody else is doing it.
For fun and profit.
Why study anything else?

11

12

Lectures

Lectures

Traditional lectures. Introduce new material.

Traditional lectures. Introduce new material.

Electronic devices. Permitted, but only to enhance lecture.

Flipped lectures.

Watch videos online before lecture.


Complete pre-lecture activities.
Attend only one "flipped" lecture per week
(interactive, collaborative, experimental).

Apply via web ASAP:


no

no

results by 5pm today.

no

What

When

Where

Who

Office Hours

What

When

Where

Who

Office Hours

L01

MW 1112:20

McCosh 10

Kevin Wayne

see web

L01

MW 1112:20

McCosh 10

Kevin Wayne

see web

Andy Guna

see web

Josh Hug

Frist 307

W 1112:20

L02
13

14

Precepts

Coursework and grading

Discussion, problem-solving, background for assignments.

Programming assignments. 45%

Due on Tuesdays at 11pm via electronic submission.


Collaboration/lateness policies: see web.

What

When

Where

Who

Office Hours

P01

Th 1111:50

CS 102

Andy Guna

see web

P02

Th 12:301:20

Bobst 105

Andy Guna

see web

P03

Th 1:302:20

Bobst 105

Nevin Li

see web

P04

F 1010:50

Bobst 105

Jennifer Guo

see web

P05

F 1111:50

Bobst 105

Madhu Jayakumar

see web

Exams. 15% + 30%

P05A

F 1111:50

Sherrerd 001

Ruth Dannenfelser

see web

P06

F 2:303:20

Friend 108

Chris Eubank

see web

Midterm (in class on Wednesday, March 12).


Final (to be scheduled by Registrar).

P06A

F 2:303:20

Friend 111

TBA

see web

P06B

F 2:303:20

Friend 109

Josh Hug

see web

P07

F 3:304:20

Friend 108

Josh Hug

see web

likely to change

lead preceptor

Exercises. 10%

Due on Sundays at 11pm in Blackboard.


Collaboration/lateness policies: see web.
Final
Programs

Midterm

Staff discretion. [adjust borderline cases]

Report errata.
Contribute to Piazza discussion forum.
Attend and participate in precept/lecture.
15

Exercises

16

Resources (textbook)

Resources (web)

Required reading. Algorithms 4th edition by R. Sedgewick and K. Wayne,

Course content.

Addison-Wesley Professional, 2011, ISBN 0-321-57351-X.

Course info.
Lecture slides.
Flipped lectures.
Programming assignments.
Exercises.
Exam archive.

http://www.princeton.edu/~cos226

Algorithms
F O U R T H

1st edition (1982)

2nd edition (1988)

E D I T I O N

Booksite.

3rd edition (1997)


R O B E R T

S E D G E W I C K

K E V I N

W A Y N E

Brief summary of content.


Download code from book.
APIs and Javadoc.

4th edition (2011)


3rd book scanned
by Google books

Available in hardcover and Kindle.

Online: Amazon ($60/$35 to buy), Chegg ($25 to rent), ...


Brick-and-mortar: Labyrinth Books (122 Nassau St).
On reserve: Engineering library.

http://algs4.cs.princeton.edu
17

Resources (web)

18

Resources (web)

http://www.princeton.edu/~cos226

http://www.princeton.edu/~cos226
19

20

Resources (web)

Resources (web)

http://www.princeton.edu/~cos226
21

Where to get help?

22

Where not to get help?

Piazza discussion forum.

Low latency, low bandwidth.


Mark solution-revealing questions

http://piazza.com/princeton/spring2014/cos226

as private.

Office hours.

High bandwidth, high latency.


See web for schedule.
http://www.princeton.edu/~cos226

Computing laboratory.

http://world.edu/academic-plagiarism

For help with debugging.


See web for schedule.

http://www.youtube.com/watch?v=FT4NOe4vtoM

Undergrad lab TAs in Friend 017.

http://www.princeton.edu/~cos226
23

24

What's ahead?
Lecture 1. [today] Union find.
Lecture 2. [Wednesday] Analysis of algorithms.
Flipped lecture 1. [Wednesday] Watch video beforehand.
Precept 1. [Thursday/Friday] Meets this week.
Exercise 1. Due via Bb submission at 11pm on Sunday.
Assignment 1. Due via electronic submission at 11pm on Tuesday.
protip: start early

Right course? See me.


Placed out of COS 126? Review Sections 1.11.2 of Algorithms 4/e.

Not registered? Go to any precept this week.


Change precept? Use SCORE.

see Colleen Kenny-McGinley


in CS 210 if the only precepts
you can attend are closed

25

You might also like