Instructor:
- Jared Saia
(saia@cs.unm.edu. Please put
the text "cs361" in the subject line, this helps my mail reader parse
your email. I read email once every afternoon at around 3pm, I'll
respond to your email as soon as I read it, please be patient)
- Office: FEC 301H, phone: 277-5446
- Office Hours: Tuesdays
1-2pm, Fridays 2-3pm, or by appointment (note that the times I'm most
likely to be in the office are all day Tuesday and Friday
afternoons)
Teaching Assistant
- Kanglin Xu
(klxu@cs.unm.edu)
- Office Hours: Mon 4:30-6:30, Weds 4:30-6:30, both in FEC 301C
- Section: Th 3:30-4:20 ME208, F 1:00-1:50 TAPY 218 (you must
register for one of these)
Meeting Times:
- Tuesdays and Thursdays 9:30-10:45 in
Dane Smith Hall, Room #229. (Dane Smith is the large building NW of
the duck pond). Last class is May 8th.
Course Description
From the cs dept web page: An introduction to data structures and
algorithms and the mathematics needed to analyze their time and space
complexity. Topics include 0( ) notation, recurrence relations and
their solution, sorting, hash tables, priority queues, search trees
(including at least one balanced tree structure), and basic graph
representation and search. Course includes programming projects.
Prerequisite: 201, 251L, and Math 163L.
Text:
Our text is Introduction to Algorithms, second
edition by Thomas H. Cormen, Charles E. Leiserson, Ronald
L. Rivest, and Clifford Stein. This book is the "bible" for algorithm
design and analysis.
What you should know
- concept of abstract data type (ADT)
- good programming skills in C, C++, or Java
- 2 semesters of calculus (infinite sums and limits, derivatives, etc)
- CS201, CS251L, and Math 163L
What you will learn
- Asymptotic analysis and recurrence relations (mathematical tools
for finding the run time of an algorithm)
- Intermediate level data structures (heaps, balanced trees, hash tables)
- Intermediate level algorithms (sorting, introduction to graphs)
- Basic knowledge of how to construct formal proofs regarding
algorithm efficiency and correctness
- How to code up intermediate algorithms and data structures, how
to design experiments to compare efficiencies of implementations
Assignments:
Administrivia on HWs
- Assignments are due at the beginning of class on the due
date.
- Late assignments not accepted without prior approval (easy for
one, harder for two, very difficult for three or more).
- Put pages of hw in order. We don't care what order you
solve the hw in, but before you turn it in, you must put the problems
in order (this makes grading easier)
- Staple hws, do not use paper clips, folding, tape, putty,
gum, etc. Prof Saia and Kanglin do not bring staplers to class, so
make sure you staple the hw before class (stapling helps us keep
together all pages of your hw)
- Regrades: if you feel a mistake was made grading your hw, please
let Kanglin know about it (if you still feel there is a problem,
then please talk to Prof. Saia). Please ask for a regrade within one
week of receiving the graded assignment.
Notes on Grading Hws
Your hws should have the following properties. We will be looking for
these when we grade:
- Clarity: Make sure all of your work and answers are clearly
legible and well separated from other problems. If we can't read it,
then we can't grade it. Likewise, if we can't immediately find all of
the relevant work for a problem, then we will be more likely to grade
only what we see at first.
- Completeness: Full credit for all problems is based on both
sufficient intermediate work (the lack of which often produces a
'justify' comment) and the final answer. There are many ways of doing
most problems, and we need to understand exactly how YOU chose to solve
each problem.
Here is a good rule of thumb for deciding how much detail is sufficient:
if you were to present your solution to the class and everyone understood
the steps, then you can assume it is sufficient.
- Succinctness: The work and solutions which you hand-in should be
long enough to convey exactly why the answer you get is correct, yet
short enough to be easily digestible by someone with a basic knowledge
of this material.
If you find yourself doing more than half a page of dense algebra,
generating more than a dozen numeric values or using more than a page of
paper per problem, you're probably doing too much work.
Don't turn in pages with scratch work or multiple answers - if you need to
do scratch work, do it on separate scratch paper. Clearly indicate your
final answer (circle, box, underline, etc.).
Topics
Topics will likely include:
- Review: Asymptotic Analysis (Chapter 3 in text) and Recurrence
Relations: recursion trees, master method, annihilators (2 weeks)
-
- Asymptotic Analysis and Big-O notation. These are mathematical
tools for analyzing the running time of algorithms and data
structures. We'll also review logarithms (1 week, Chapter 3 in text)
- Recurrence Relations: How to formulate them and how to use
annihilators and change of variable transformations to solve them.
Recurrence relations are mathematical tools for analyzing the
performance of algorithms. (2-3 weeks, Chapter 4 in text)
- Sorting algorithms: Bubble sort, merge sort(divide and conquer)
and quicksort(worst vs. average case behavior), loop invariants, and
proofs of correctness. Time permitting, we'll discuss various
selection algorithms. (2 weeks, Chapters 7 and 8)
- Probability and Expectation: Basic probability theory, linearity
of expectation, birthday paradox, coupon collector's problem, average
case analysis of quicksort. Probability theory is another
mathematical tool for analysis or randomized algorithms. (2 weeks,
Cahpter 5)
- Heaps and Priority Queues: ADT's and implementations, Linked
List versus Binary heap. (1 week, Chapter 6)
- Binary Search Trees: Detailed descriptions and analyses of skip lists
and AVL trees (p. 296 in book). High level descriptions of splay
trees, red-black trees and B-trees. (2 weeks, Chapter 12 and p. 296)
- Hash Tables: Insert, find and delete in O(1) time, use of
pseudo-randomness to get good hash functions. (1 week, Chapter 11)
- Graph Algorithms (time permitting): Shortest paths problem, Dijkstra's algorithm,
minimum spanning tree problem and Prim's and Kruskall's algorithms,
proofs of correctness of Prims and Kruskalls. (2 weeks, Chapters 22
and 23)
Course Assessment
Approximate weighting:
- Class Project, 30%
- Homeworks, 30%
- Midterm and Final, 30% (20% final and 10% midterm)
- Class Participation, 10% . I expect about 90% attendance in
class, There will be frequent in-class exercises, and I will call on a
random person in the class to answer. The participation grade will be
based on a check system:
- If I call on you for an in-class exercise, and you give an educated
guess, ask me an intelligent question, or give a partial answer, you get one check
- If I call on you for an in-class exercise, and you give a correct
or near-correct answer, you get two checks
- If you come to my office hours, you get one check (good for one
time only)
The more checks you have, the better your participation grade.
Policies
Assignment deadlines are strict: late homework will automatically
receive a grade of zero, unless reasonable cause can be shown (which
is easy for one, possible for two, and very hard for three or more!);
no make-up.
Collaboration is encouraged on all of the homeworks although the
solutions should be written up individually unless stated otherwise.
Usual university policies for withdrawals, incompletes and academic
honesty.
Grades assigned at the end of the semester are final. You
will not be able to do any extra credit projects, papers, etc. to
change your grade.