CS 1501 Algorithms and Data Structures 2

Fall 2021

 

Contact Information

Instructor

 

 

Office Hours

Sherif Khattab, 6307 SENSQ

(412) 624-8438

skhattab@cs.pitt.edu

Tu: 10:00-12:00

Th: 10:00-12:00 and 15:00-18:00

F: 8:00-10:00 and 15:00-16:00 (remote only)

Zoom link: https://pitt.zoom.us/my/khattab

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

TA

 

 

 

Office Hours

 

 

 

 

 

 

 

 

TA

 

 

Office Hours

 

Nannan Wen (11109), 6508 SENSQ

naw66@pitt.edu

Gordon Lu (30869), 5806 SENSQ

lu.gordon@pitt.edu

Vivek Rajkumar (31246), 5806 SENSQ

vrr11@pitt.edu

 

Th: 10:00-11:00

 

Zoom Meeting ID: 930 0005 2711

Pass code: 20211501

 

 

M: 13:00-15:00

F: 16:00-18:00P

and by appointment

 

Zoom link:

https://pitt.zoom.us/j/4813388358

 

Note: Office hours are in-person except if you book an appointment using https://glu99331-office-hours.youcanbook.me/

W: 18:30-20:30 (in-person after 9/13)

Su:14:00-15:00 (remote)

 

Zoom link: https://pitt.zoom.us/my/vrr11

 

Lauren Burckstein (24005), 5806 SENSQ

leb127@pitt.edu

Norhan Abbas (Grader for Section 1150)

norhan.abbas@pitt.edu

Sabit Hassan (Section 1500)

sah259@pitt.edu

 

W: 9:30-11:00 (remote)

F: 14:00-15:30 (in person)

 

Zoom link: https://pitt.zoom.us/j/9443805281

 

 

M, W, Th, Fri: 9:50-10:50

Tu: 9:50-11:50

 

Zoom link: https://pitt.zoom.us/j/93358585131

M: 10:50-12:50

W: 14:20pm - 16:20pm

F: 12:00-14:00

 

Zoom link: https://pitt.zoom.us/j/4357638617

 

 

Lectures

 

Section 1500: MW 11:00 -12:15 @ 5201 Wesley W Posvar Hall
Section 1150: MW 15:00-16:15 @ 1500 Wesley W Posvar Hall

Recitations

11109 (1150): Thursday 09:00-09:50 @ SENSQ 5505
30869 (1150): Thursday 11:00-11:50 @
SENSQ 5505

31246 (1150): Friday 14:00-14:50 @ SENSQ 5313

24005 (1150): Friday 16:00-16:50 @ SENSQ 5502

31244 (1500): Thursday 10:00-10:50 @ SENSQ 5505

31245 (1500): Friday 11:00-11:50 @ SENSQ 5502

Student Feedback

Please send us your anonymous feedback

Top Hat Join Code

763850

 

Course Description

 

This course covers a broad range of the most 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.

 

The class has two main learning outcomes:

1.     To convert non-trivial algorithms into programs and

2.     To analyze and compare run-times of algorithms

 

Prerequisites

 

CS 0441 and CS 0445

 

Textbooks

 

 

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

ISBN-13: 9780321573513 (Available online via Pitt's library)

 

F. M. Carrano and T. M. Henry, Data Structures and Abstractions with Java (5th Ed.)
ISBN-10: 0134831691 (Available at Bevier Engineering Library Reserve Desk; QA76.9.D33 C37 2019)

Grading Policy

 

Programming Assignments (40%): best four out of five assignments. 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.

 

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.

 

Midterm and Final exams (20%): 12% on higher grade and 8% on lower. Make-up exams can be scheduled well in advance. The exams are remote and non-cumulative.


Homework assignments (20%): Twelve homework assignments worth 2% each. The lowest two homework assignments will be dropped.


Recitation Participation
(10%): Twelve lab exercises worth 1% each. The lowest two lab assignments will be dropped.

 

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

 

CourseMIRROR: This semester, we are using a new digital tool, CourseMIRROR that collects data from student reflections to help instructors identify difficulties that students encounter and provide additional feedback and support for student learning throughout the semester. Please be sure to submit your reflections after each lecture using the CourseMIRROR mobile app. You will receive 1% of extra credit for your participation when the response rate is 60% or more. The passcode for the MW 11:00 am section is hdihcq and for the MW 3:00 pm section is tyunqf.

Important Dates (Tentative)

 

Midterm Exam

W 10/13 at regular class time

Final Exam

TBD

 

 

 

 

 

 

Weekly Schedule (Tentative)

Assignment #

Out on

Due on @11:59pm

1

M 9/6

F 10/1

2

F 10/1

M 10/25

3

M 10/25

F 11/12

4

F 11/12

M 11/29

5

M 11/29

M 12/13

 

 

Week

Topic

Reading

Announcements

Wk 1 (8/30-9/3)

Intro. Material; Course Policies and Goals

 

Converting algorithms to programs; comparing algorithm implementations; algorithm analysis

 

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

Handout, Notes

 

Sedgewick Section 1.4

 

 

 

Notes

Wikipedia

 

 

Wk 2 (9/6-9/10)

M: Labor Day (no classes)

 

ADT Tree: Concepts, binary tree (full, complete), traversals (pre, in, post, level orders), tree implementation (multiple interfaces), binary nodes, binary tree implementation

 

 

Carrano Chapter 23,24

Assignment 1 out on 9/6

 

Fall Term add/drop period ends on 9/10

Wk 3 (9/13-9/17)

Binary Search Tree: Implementation using binary nodes (adding, removing nodes) and algorithm analysis (run-time)

Carrano Chapter 25

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

Wk 4 (9/20-9/24)

Self-balancing trees

 

stack instead of recursion, iterator

 

Symbol Table ADT: array, linked-list, binary search tree

 

Notes

Wk 5 (9/27-10/1)

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

 

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

Notes

Sedgewick Sec. 3.1-3.2

 

Notes

Sedgewick Sec. 5.2

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

Assignment 2 out on 10/1

Wk 6 (10/4-10/8)

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

 

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

Notes

Sedgewick Sec. 5.5

 

 

 

 

 

 

 

Wk 7 (10/11-10/15)

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

 

Midterm exam

 

F: Fall Break for students (No Classes)

Notes

Sedgewick Section 4.1

 

Review for the midterm

Midterm exam on Wednesday 10/13

Wk 8 (10/18-10/22)

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

 

Connected components

 

Articulation points and biconnected components

Notes

Sedgewick Section 4.1

 

Wk 9 (10/25-10/29)

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

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

Assignment 3 out on 10/25

Wk 10 (11/1-11/5)

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

 

Brief discussion of Kruskal's MST algorithm

Sedgewick Section 2.4

 

 

Notes

Sedgewick Section 4.3

Wk 11 (11/8-11/12)

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

 

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)

Sedgewick Section 4.4

 

 

Notes

Sedgewick pp. 886-902

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

Assignment 4 out on 11/12

Wk 12 (11/15-11/19)

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)

 

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

 

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)

See Notes for references

 

 

 

See Notes for references

 

 

See Notes for references

 

 

Notes

See online references in notes

 

 

 

Notes

See online references in notes

 

Thanksgiving Recess (No Classes)

Wk 13 (11/29-12/3)

Min-Cut vs. Max Flow

 

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. 886-902

 

Notes

Sedgewick pp. 903-921

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

Assignment 5 out on 11/29

Wk 14 (12/6-12/10)

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

 

 

Finals Week (12/13-12/17)

Final Exam

Prepare for the final

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

Final exam TBD

 

Communication Policy

 

 

There are many ways to communicate with the teaching team. Please reach out to us as early as possible and as frequently as possible. You can reach us on:

Piazza

Canvas Messages

Email

Please expect a response within 72 hours.

 

Your Well-being Matters

College/Graduate school can be an exciting and challenging time for students. Taking time to maintain your well-being and seek appropriate support can help you achieve your goals and lead a fulfilling life. It can be helpful to remember that we all benefit from assistance and guidance at times, and there are many resources available to support your well-being while you are at Pitt. You are encouraged to visit Thrive@Pitt to learn more about well-being and the many campus resources available to help you thrive. 

 

If you or anyone you know experiences overwhelming academic stress, persistent difficult feelings and/or challenging life events, you are strongly encouraged to seek support. In addition to reaching out to friends and loved ones, consider connecting with a faculty member you trust for assistance connecting to helpful resources. 

 

The University Counseling Center is also here for you. You can call 412-648-7930 at any time to connect with a clinician. If you or someone you know is feeling suicidal, please call the University Counseling Center at any time at 412-648-7930. You can also contact Resolve Crisis Network at 888-796-8226. If the situation is life threatening, call Pitt Police at 412-624-2121 or dial 911.

 

Health and Safety Statement

I would like to emphasize that my number one concern is your safety and health, both physical and mental.  My goal is for each and every one of you to succeed in the course. I am here to support you and I will remain understanding and flexible given the challenges that we are all facing together. The lectures and recitations will be recorded, and the recorded sessions include your participation. The recorded sessions will be made available through Canvas and only to this term's class.

 

During this pandemic, it is extremely important that you abide by the public health regulations , the University of Pittsburgh's health standards and guidelines, and Pitt's Health Rules. These rules have been developed to protect the health and safety of all of us.  Universal face covering is required in all classrooms and in every building on campus, without exceptions, regardless of vaccination status. This means you must wear a face covering that properly covers your nose and mouth when you are in the classroom. If you do not comply, you will be asked to leave class.  It is your responsibility have the required face covering when entering a university building or classroom. For the most up-to-date information and guidance, please visit coronavirus.pitt.edu and check your Pitt email for updates before each class.

If you are required to isolate or quarantine, become sick, or are unable to come to class, contact me as soon as possible to discuss arrangements.

 

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


All assignment submissions must be the sole work of each individual student. Students may not read or copy another student's solutions or share their own solutions with other students. Students may not review solutions from students who have taken the course in previous years. Submissions that are substantively similar will be considered cheating by all students involved, and as such, students must be mindful not to post their code publicly. The use of books and online resources is allowed, but must be credited in submissions, and material may not be copied verbatim. Any use of electronics or other resources during an examination will be considered cheating. If you have any doubts about whether a particular action may be construed as cheating, ask the instructor for clarification before you do it. The instructor will make the final determination of what is considered cheating. Cheating in this course will result in a grade of F for the course and may be subject to further disciplinary action. 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: Academic Integrity Policy of the School of Computing and Information.

Pay attention to the following examples of cheating, which include:

Sharing code: either by copying, retyping, looking at, or supplying a copy of a file from this or a previous semester.

Describing code: Verbal description of code from one person to another.

Coaching: Helping your friend to write a lab, line by line.

Copying: Copying code from the Web or another student. You are only allowed to use code that we provide you.

Searching: Searching the Web for solutions or for any advice on the lab.


Cheating is also looking at other students' code or allowing others to look at yours. This includes one person looking at code and describing it to another. Be sure to store your work in protected directories (e.g., under the private folder on your AFS space on the department servers), and log off when you leave a remote server, to prevent others from copying your work without your explicit assistance.

You may find it useful to know what is not cheating:

Clarifying ambiguities or vague points in class handouts, lectures, or textbooks.

Helping others use the computer systems, networks, compilers, debuggers, profilers, or other system facilities.

Helping others with high-level design issues only, but algorithm/coding and other such details are not ``high-level design issues''.

Helping others with high-level (not code-based) debugging.

Using code from the skeleton/package provided in class is always OK.

For a first offense, a student caught collaborating or cheating in any way will receive a zero for the exam, homework, lab, 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. They will be reported to the school following University procedures. 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.

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.

Equity, Diversity, and Inclusion

The University of Pittsburgh does not tolerate any form of discrimination, harassment, or retaliation based on disability, race, color, religion, national origin, ancestry, genetic information, marital status, familial status, sex, age, sexual orientation, veteran status or gender identity or other factors as stated in the University's Title IX policy. The University is committed to taking prompt action to end a hostile environment that interferes with the University's mission. For more information about policies, procedures, and practices, visit the Civil Rights & Title IX Compliance web page.

I ask that everyone in the class strive to help ensure that other members of this class can learn in a supportive and respectful environment. If there are instances of the aforementioned issues, please contact the Title IX Coordinator, by calling 412-648-7860, or e-mailing titleixcoordinator@pitt.edu. Reports can also be filed online. You may also choose to report this to a faculty/staff member; they are required to communicate this to the University's Office of Diversity and Inclusion. If you wish to maintain complete confidentiality, you may also contact the University Counseling Center (412-648-7930).

 

Copyright Statement

 

These materials may be protected by copyright. United States copyright law, 17 USC section 101, et seq., in addition to University policy and procedures, prohibit unauthorized duplication or retransmission of course materials. See Library of Congress Copyright Office and the University Copyright Policy.

 


Classroom Recording

 

 

To ensure the free and open discussion of ideas, students may not record classroom lectures, discussion and/or activities without the advance written permission of the instructor, and any such recording properly approved in advance can be used solely for the student's own private use.