Pitt Logo

CS 0445 - Algorithms and Data Structures 1

Fall 2022

 

Contact Information

Instructor

 

 

Student Support Hours

Sherif Khattab, 6307 SENSQ

(412) 624-8438

skhattab@cs.pitt.edu

MW: 10:00-12:00

TuTh: 13:00-15:00

F: by appointment

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

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

Lectures

 

TuTh 09:30 -10:45 @ 5502 Sennott Square

TA

 

 

 

Student Support Hours

 

 

 

 

 

 

TA

 

 

Student Support Hours

 

 

 

 

 

Radley Lettich, 5806 SENSQ

(Recitation TA for 27657)

ral109@pitt.edu

Julia Malnak, 6104 SENSQ

(Recitation TA for 10681)

jum97@pitt.edu

M: 16:30- 18:00

Th: 16:00-16:45, 17:45-18:30

F: 12:00-14:30

M, W, Th: 19:00-21:00 by appointment (via email, 1h+ in advance)
Note: Zoom Meeting Link: https://pitt.zoom.us/j/3349431748

for both recitation and virtual student support hours as desired)

W: 11:00-13:00 @ 1A04 IS

Th: 14:30-16:00

Note: appointments can be made by availability via email

 

 

Evan Kozierok

(Recitation TA for 22563)

eak80@pitt.edu

Yueqi Wang, 6150 SENSQ

(Grader TA)

yuw249@pitt.edu

M: 12:45-14:45pm @ 5806 SENSQ

T: 13:30-15:30pm @ Digital Scholarship Commons on the ground floor of Hillman Library

Th: 13:00-15:30pm @ Digital Scholarship Commons

Note: appointments available via email

TuTh: 9:30-11:00

Recitations

27657: Friday 10:00-10:50 @ IS 403
10681: Friday 13:00-13:50 @ IS 403

22563: Friday 16:00-16:50 @ IS 405

Student Feedback

Please send us your anonymous feedback

Top Hat Join Code

437194

 

Course Description

 

This course emphasizes the study of the basic data structures of computer science (e.g., stacks, queues, lists, hash tables) and their implementations using the Java language. Included in this course are programming techniques that use recursion, reference variables, and dynamic memory allocation. Students in this course are also introduced to various searching and sorting methods and expected to develop an intuitive understanding of the complexity of these algorithms.

 

Prerequisites

 

CS 0441

 

Textbooks

 

 

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. After two days, the assignment grade is zro. The assignments will be handed out using Github Classroom and submitted on the Gradescope platform.

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 in-person 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 437194.

Important Dates (Tentative)

 

Midterm Exam

Th 10/20 at regular class time

Final Exam

According to PeopleSoft Exam Schedule

 

 

 

 

 

 

Weekly Schedule (Tentative)

Programing Assignment #

Out on

Due on @11:59pm

1

F 9/9

F 10/7

2

F 10/7

F 10/28

3

F 10/28

F 11/11

4

F 11/11

F 12/2

5

F 12/2

Su 12/18

 

 

Week

Topic

Reading

Announcements

Wk 1

(8/29-9/2)

Introduction; Course goals and policies;

 

References, pointers and memory; Building new classes via composition; copying objects and shallow vs. deep copy; generics; review of polymorphism; abstract classes; exceptions; file I/O

Introduction

Prelude

Interlude 1, 2, 3, 5, 7, 8, 9

Appendix A-C

Supplement 2

 

Wk 2

(9/5-9/9)

M: Labor Day (no classes)

 

ADT Bag (specifications, example use, fixed size array implementation)

 

ADT Bag -- dynamic size array implementation; resizing process

 

Issues with array-based data structures

Ch. 1, 2

 

Assignment 1 out on 9/9

 

Spring Term add/drop period ends on 9/9

Wk 3

(9/12-9/16)

Intro. to linked lists; linked implementation of a Bag (add, contains and remove methods; version with separate Node class)

 

Linked implementation of the Bag ADT and comparing implementations

Ch. 3, 4

Spring Term extended add/drop period ends on 9/16

Wk 4

(9/19-9/23)

List ADT (idea; operations and use; standard Java List)

 

Linked Implementation of ListInterface; insertion and deletion from the middle of a list; special cases; adding a lastNode reference; LL variations

 

Array List ADT implementation; differences from Bag; inserting and deleting in the middle of the list

 

Standard Java ArrayList and Vector

 

Intro to Algorithm Analysis -- idea and rationale for using it; Big-Oh definitions and idea

 

Algorithm Analysis -- simple examples; binary search; analysis of Bag operations; resizing and amortized time

Ch. 10

 

 

Ch. 12

 

 

 

 

Ch. 11

 

 

 

 

 

Ch. 4

Wk 5

(9/26-9/30)

Stack ADT (idea; examples (matching parentheses, evaluating post-fix expressions); implementation (array and linked list))

Ch. 5, 6

Wk 6

(10/3-10/7)

Intro. to Recursion (Review of idea and definitions; review of implementation)

 

Simple recursive functions; recursive sequential search (on both array and linked list)

 

Idea of Divide and Conquer; divide and conquer version of the power function

Ch. 9

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

Assignment 2 out on 10/7

Wk 7

(10/10-10/14)

Recursive binary search; overhead of recursive implementations; introduction to backtracking

 

Eight Queens problem (discussion, idea, solution); FindWord in a grid problem (discussion, idea, solution)

 

Towers of Hanoi (discussion, trace)

F: Fall Break for Students (no classes)

Ch. 9

Wk 8

(10/17-10/21)

Runtime analysis of recursive functions

Prepare for

the midterm

Midterm exam on Thursday 10/20

Wk 9

(10/24-10/28)

Intro. to Sorting: idea

 

Simple sorts: InsertionSort (algorithm, run-time, linked list version and differences)

 

Simple sorts: SelectionSort (algorithm, run-time, differences from InsertionSort)

 

Bubblesort (brief overview)

 

Improved sorting with Shellsort (idea, algorithm)

Ch. 15

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

Assignment 3 out on Friday 10/28

Wk 10

(10/31-11/4)

Improvement with divide and conquer (idea); Idea of Mergesort (dividing the data, merging the data to sort); pseudocode; "merge" algorithm (code, not sorting in place)

 

Run-time analysis of Mergesort (informal; execution tree; slightly more formal analysis); Comparison with Towers of Hanoi run-time; overhead of merging

 

Quicksort idea (partitioning the data, recursive calls); pseudocode; partition algorithm trace / implementation; best case, worst case, average case analysis of QuickSort with simple partition; improving Quicksort with median of three; other Quicksort variations; optimizing QuickSort with choice of base case

 

Quicksort vs. Mergesort (run-time, stability, etc)

 

Radix Sort (idea, algorithm, run-time)

Ch. 16

Wk 11

(11/7-11/11)

Iterators (idea, why we might want to use them, interface); iterators in a linked list (design, implementation); iterators for array lists, ListIterator; Concurrent modification; Iterable interface

Ch. 13

Interlude 4

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

Assignment 4 out on Friday 11/11

Wk 12

(11/14-11/18)

Dictionaries as an ADT; intro to hashing; idea of hashing; collisions and avoiding collision; good hash functions; resolving collisions with linear probing; load factor and its effect on linear probing

 

Double hashing to reduce collisions as table fills; issues with double hashing; resizing open addressing tables to keep alpha small; delete with open addressing; separate chaining (idea; structure, example, run-time); author's implementation of a linear probing hash table

Ch. 20, 22, 23

 

Thanksgiving Recess for students (no classes)

Wk 13

(11/28-12/2)

String matching algorithms (brute force, Rabin Karp, Boyer Moore) -- ideas, algorithms, run-times, discussion

Notes

Assignment 4 due on 12/2 @ 11:59pm

Assignment 5 out on Friday 12/2

Wk 14

(12/5-12/9)

Queue ADT (review; linked implementation; circular linked implementation; 2-part circular linked implementation)

 

Deque ADT (review; circular array implementation; linked implementation issues)

Ch. 8

 

Finals Week

(12/12-12/16)

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

Final exam date, time, and locations are according to PeopleSoft Exam Schedule

 

Communication Policy

 

 

Please reach out to the teaching team as early as possible and as frequently as possible. You can reach the course instructor during office hours and on Piazza (you can send public and private messages).

Please expect a response within 72 hours. Any other communication method (e.g., email) is not recommended.

 

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 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 some 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'health standards and guidelines, and Pitt's Health Rules. These rules have been developed to protect the health and safety of all of us. The University's requirements for face coverings will at a minimum be consistent with CDC guidance and masks are required indoors (campus buildings and shuttles) on campuses in which COVID-19 Community Levels are High. This means that when COVID-19 Community Levels are High, 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 to have the required face covering when entering a university building or classroom. Masks are optional indoors for campuses in which county levels are Medium or Low. Be aware of your Community Level as it changes each Thursday. Read answers to frequently asked questions regarding face coverings. For the most up-to-date information and guidance, please visit the Power of Pitt site 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. Arrangements include, but are not limited to, providing a Zoom link to join class remotely.

 

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 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


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.