index_files/image001.png

CS 1501 Algorithm Implementation (COE 1501)

Fall 2018

 

Contact Information

Instructor

 

 

 

Office Hours

Sherif Khattab, 6307 SENSQ

(412) 624-8438

skhattab@cs.pitt.edu

 

MW: 10am-4pm and by appointment

Please reserve at: https://khattab.youcanbook.me/

TAs

 

 

Sections 1270/1280

 

 

 

Sections 1400/1410

 

Nathan Ong, 6804 SENSQ

nro5@pitt.edu

OH: T 10-11AM and F 10-Noon 

Ziyu Zhang (Ronian), 6805 SENSQ

ziz41@pitt.edu

OH: W 2-5pm

(Grader)

Hanzhong Zheng (Victor), 6150 SENSQ

haz78@pitt.edu

OH: T 1:30-4:30PM

Jie Liu, 5501 SENSQ

jil251@pitt.edu

OH: MW 11:30-1PM

(Grader)

Lectures

 

Th 19:00-21:45 @ BENDM 226 (Section 1400 and 1410)

TuTh 14:30-15:45 @ BENDM G26 (Section 1270 and 1280)

Recitations

28572 and 28573: Tuesday 19:30-20:30 @ SENSQ 5502

28575 and 28576: Wednesday 19:30-20:30 @ SENSQ 5502

25771 and 25772: Wednesday 9:00-9:50 @ SENSQ 5505

25769 and 25770: Thursday 11:00-11:50 @ SENSQ 5505

Student Feedback

Please send us your anonymous feedback

Top hat join code

064642

 

Course Description

 

This course covers a broad range of the most commonly used algorithms. Some examples include algorithms for sorting, searching, encryption, compression and local search. The students will implement and test several algorithms. The course is programming intensive.

 

Prerequisites

 

CS 0441 and CS 0445

 

Textbook

 

 

Robert Sedgewick and Kevin Wayne, Algorithms, 4th Edition, Addison-Wesley, 2011.

ISBN-13: 9780321573513 (The book is on reserve at the Engineering Library Reserve Disk http://pittcat.pitt.edu/cgi-bin/Pwebrecon.cgi?BBID=6473761)

 

(Recommended for W Section) Nicholas J. Higham, Handbook of Writing for the Mathematical Sciences, 2nd Edition, SIAM, 1998.

ISBN 0-89871-420-6 (The book is on reserve at the Engineering Library Reserve Disk http://pittcat.pitt.edu/cgi-bin/Pwebrecon.cgi?BBID=66633)

Grading Policy

 

Midterm and Final exams (40%): 26% on higher grade and 14% on lower. Make-up exams can be scheduled well in advance.

 

Programming Assignments (40%): best four out of five assignments worth 10% each. Late submissions are allowed for up to two days with a 10% reduction per late day.

This must be your own individual work. Do not look at the solution of anyone (or even part of it), and do not let anyone else look at yours (or even part of it). You should figure out the solutions by yourself --- do not ask anyone how to solve the problem, and do not seek the answer from some other source. For a first offense, a student caught collaborating or cheating in any way will receive a zero for the exam, homework, or project in question. In the event of a second offense, the student will receive an F for the course and may be subject to stronger action. Note: Submissions that are alike in a substantive way (not due to coincidence) will be considered to be cheating by ALL involved parties. Please protect yourselves by only storing your files in private directories, and by retrieving all printouts promptly.

 

Students are expected to have a backup disk (or storage somewhere) for every assignment they turn in. In this way, if there is any problem with the copy that is handed in the backup can be used for grading purposes.

 

The write-ups for the W Section students will be substantial and will have significant weight toward the overall assignment grades. They will also be graded with scrutiny for proper writing form. W section students will be required to write additional papers not required of the non-W students. Additional writing issues may be discussed in lecture and in recitation. At least one paper will be subject to one or more revisions after feedback from the course instructor or grader. Initial paper grades as well as revision grades will be factored into the overall course grade.

 

Recitation Participation (10%): Participation here means putting reasonable effort into solving the lab exercises.

 

Lecture Quizzes (10%): Mini-quizzes on Top Hat during each lecture. The join code for Top Hat is 064642.

Important Dates

 

Midterm Exam

Thursday 10/11

Final Exam

Thursday 12/13 19:00-20:50 (for the Thursday 7pm sections: 1400 and 1410)

Tuesday 12/11 8:00-9:50 (for the TuTh 2:30pm sections: Section 1270 and 1280)

 

 

 

 

 

 

Weekly Schedule

Assignment #

Out on

Due on @11:59pm

1

F 9/14

M 10/1

2

M 10/1

F 10/19

3

F 10/19

M 11/5

4

M 11/5

F 11/23

5

F 11/23

F 12/7

 

 

Week

Topic

Reading

Announcements

Wk 1 (8/27-8/31)

Intro. Material; Course Policies and Goals

 

Converting algorithms to programs; comparing algorithm implementations; algorithm analysis

Handout, Notes

 

Sedgewick Section 1.4

 

Wk 2 (9/3-9/7)

Intro. to exhaustive search; pruning, recursion and backtracking; 8-Queens and Boggle examples

 

Review of searching techniques (array, linked-list, binary search tree); Symbol Table ADT

 

 

Digital search trees (idea; comparison to binary search trees); radix search tries (idea; structure); multiway tries (idea; structure; implementation; run-time; overhead)

Notes

Wikipedia

 

Notes

Sedgewick Sec. 3.1-3.2

 

 

Sedgewick Sec. 5.2

Fall Term add/drop period ends on 9/7

Wk 3 (9/10-9/14)

de la Briandais trees (idea; structure, run-time)

 

 

Intro. to hashing (idea; collisions); collision resolution (open addressing vs. closed addressing)

Notes

Sedgewick Sec. 5.2

 

Sedgewick Sec. 3.4

Fall Term extended add/drop period ends on 9/14

Assignment 1 out on 9/14

Wk 4 (9/17-9/21)

Hashing: good vs. bad hash functions; hashing a string (idea; Horner's method); open addressing via linear probing; clustering; open addressing via double hashing; limitations of open addressing (deletion, resizing); closed addressing via separate chaining; other possible closed addressing schemes

 

Substring Matching: idea; brute force algorithm; worst and expected cases; KMP algorithm (idea and very brief discussion); Rabin-Karp Algorithm (idea; implementation; run-time; monte-carlo vs. las vegas)

 

Substring Matching: Boyer-Moore algorithm (idea; implementation; improvement in normal case; worst case); Overall comparison of algorithms

Notes

Sedgewick Sec. 3.4

 

 

 

 

 

 

Sedgewick Sec. 5.3

 

 

 

Notes

Sedgewick Sec. 5.3

Wk 5 (9/24-9/28)

Intro. to Compression: Lossy vs. Lossless Compression; Common compression programs

 

Huffman compression: block coding vs. variable length coding; prefix free codes; building the Huffman tree; examining / using Huffman compression; implementing Huffman compression; limitations of Huffman compression

Notes

Sedgewick Sec. 5.5

 

 

 

 

 

Wk 6 (10/1-10/5)

Intro. to LZW compression; idea; compressing; decompressing; adaptive nature of algorithm

 

LZW compression: special case for decompression; implementation issues

 

Comparison of compression algorithms; Limits on compression and information entropy

 

 

Integer multiplication (idea; run-time for ints; mutiplying integers with N bits); Gradeschool algorithm (idea and run-time)

 

Improving divide and conquer multiplication with Karatsuba algorithm (idea; details; run-time)

Notes

Sedgewick Sec. 5.5

 

 

 

 

 

See Notes for references

 

 

 

See Notes for references

 

 

Assignment 1 due on 10/1 @ 11:59pm

Assignment 2 out on 10/1

Wk 7 (10/8-10/12)

Exponentiation and powerMod (naive algorithm and run-time; improved algorithm using divide and conquer)

 

Greatest common divisor: inefficient vs. efficient implementation

 

Intro to Encryption; symmetric ciphers, key distribution problem

 

Midterm exam

See Notes for references

 

 

 

Notes

See online references in notes

 

 

 

Review for the midterm

Midterm exam on Thursday 10/11

Wk 8 (10/15-10/19)

No Tuesday class this week (Fall Break)

 

Public key encryption (idea; RSA as most common example; RSA algorithm)

 

 

RSA key generation and related issues (random prime generation, breaking RSA)

 

Uses of RSA (Digital Envelope / TLS, Digital Signatures)

 

 

Notes

See online references in notes

Assignment 2 due on 10/19 @ 11:59pm

Assignment 3 out on 10/19

 

Wk 9 (10/22-10/26)

Intro to Graphs (idea; definitions; vertices vs. edges)

 

Simple Graph Traversals (DFS; BFS) -- idea; algorithms; run-times

 

Connected components

 

Articulation points and biconnected components

Notes

Sedgewick Section 4.1

 

 

 

 

Wk 10 (10/29-11/2)

Intro. to weighted graphs, representing weighted graphs, unweighted spanning trees and shortest paths vs. weighted spanning trees and shortest paths

 

Prim's MST algorithm (idea; naive approach; Lazy version; Eager version)

Notes

Sedgewick Section 4.3

Wk 11 (11/5-11/9)

Brief discussion of Kruskal's MST algorithm

 

 

Priority Queues and Heap implementation; Indexable PQ implementation (needed for Eager Prim)

 

 

Dijkstra's Shortest Path algorithm (similarity to Eager Prim, difference in priority)

Notes

Sedgewick Section 4.3

 

Sedgewick Section 2.4

 

 

 

Sedgewick Section 4.4

Assignment 3 due on 11/5 @ 11:59pm

Assignment 4 out on 11/5

Wk 12 (11/12-11/16)

Network Flow (idea; definitions); Ford-Fulkerson approach to finding maximum flow (augmenting paths; residual graph; finding augmentin paths, backward Flow, Edmonds and Karp algorithm, BFS vs. PFS for augmenting paths)

Notes

Sedgewick pp. 886-902

 

Wk 13 (11/19-11/23)

Min-Cut vs. Max Flow

 

No classes on Thursday

(Thanksgiving Recess)

Notes

Sedgewick pp. 886-902

Assignment 4 due on 11/23 @ 11:59pm

Assignment 5 out on 11/23

Wk 14 (11/26-11/30)

Unsolvable, Intractable and Polynomial problems

 

NP and NP-completeness; P vs. NP; showing NP completeness via reduction; approximating solutions to NP complete problems via heuristics; local search and 2-opt example for TSP

Notes

Sedgewick pp. 903-921

Wk 15 (12/3-12/7)

Dynamic Programming: Idea; "Bottom up" and "memoization"; Fibonacci example; Subset Sum problem (idea, branch and bound solution, dynamic programming solution); Knapsack problem (idea)

Notes, handouts

Assignment 5 due on 12/7 @ 11:59pm

Finals Week (12/10-12/14)

Final Exam

Prepare for

the final

Final exam on

Thursday 12/13 19:00-20:50 (for Section 1400 and 1410, the Thursday 7pm sections) and

Tuesday 12/11 8:00-9:50 (for Section 1270 and 1280, the TuTh 2:30pm sections)

 

Students with Disabilities

 

If you have a disability for which you are or may be requesting an accommodation, you are encouraged to contact both your instructor and Disability Resources and Services (DRS), 140 William Pitt Union, (412) 648-7890, drsrecep@pitt.edu, (412) 228-5347 for P3 ASL users, as early as possible in the term. DRS will verify your disability and determine reasonable accommodations for this course.

Academic Integrity

Students have the responsibility to be honest and to conduct themselves in an ethical manner while pursuing academic studies. Students have the right to be treated by faculty in a fair and conscientious manner in accordance with the ethical standards generally recognized within the academic community (as well as those recognized within the profession). Should a student be accused of a breach of academic integrity or have questions regarding faculty responsibilities, procedural safeguards including provisions of due process have been designed to protect student rights. These may be found in Guidelines on Academic Integrity: Student and Faculty Obligations and Hearing Procedures.

Religious Observances

In order to accommodate the observance of religious holidays, students should inform the instructor (by email, within the first two weeks of the term) of any such days which conflict with scheduled class activities.