Pitt Logo

CS 0445 - Algorithms and Data Structures 1

Fall 2023

 

Contact Information

Instructor

 

 

 

Office Hours

Sherif Khattab, 6307 SENSQ, Zoom room: https://pitt.zoom.us/my/khattab

(412) 624-8438

skhattab@cs.pitt.edu

 

M: 6-8 pm

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

TuTh: noon-2 pm

F: by email appointment

Lectures

 

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

TA

 

 

 

Office Hours

 

 

 

 

 

 

TA

 

 

Office Hours

 

 

 

 

 

Jason Vo, TBD

(Recitation TA for Friday @ 10 am)

jhv5@pitt.edu

Austin Gohn, TBD

(Recitation TA for Friday @ 1pm)

atg50@pitt.edu

TBD

TBD

 

 

 

 

 

 

 

 

Mason Gobat, TBD

(Recitation TA for Friday @ 4 pm)

mng28@pitt.edu

Modhumonty Das, TBD

(Grader TA)

mod53@pitt.edu

TBD

TBD

Recitations

26563: Friday 10:00-10:50 @ IS 404
10664: Friday 13:00-13:50 @ IS 406

22014: Friday 16:00-16:50 @ IS 406

Student Feedback

Please send us your anonymous feedback

Canvas Course

https://canvas.pitt.edu/courses/217726

Top Hat Join Code

Please join using the Top Hat - New link inside Canvas

 

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 0401

 

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%): Five programming assignments in Java worth 8% each. Late submissions are allowed for up to two days with a 10% reduction per late day. After two days, the assignment grade is zero. The assignments will be handed out using Github Classroom and must be 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 (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 (40%): 20% each. Make-up exams can be scheduled well in advance. The exams are in-person and non-cumulative.


Homework assignments (6%): Twelve homework assignments worth 0.5% each. Late submissions are not accepted for homework assignments.


Recitation Lab assignments
(6%): Six lab exercises worth 1% each. Late submissions are not accepted for lab assignments.

 

Lecture Quizzes (8%): Mini quizzes on Top Hat during (almost) each lecture.

 

Deadline Extension Budget Each student has a total of five free deadline extension days that they can use towards a penalty-free deadline extension of any programming, homework, or lab assignment. To use your extension budget, you must send a private message on Piazza to the Grader TA before the assignment deadline. Any extension requests beyond the free budget requires a documented excuse or a DRS accommodation.

 

Please note that the grades posted on Canvas, especially the final letter grade, are tentative.

Important Dates (Tentative)

 

Midterm Exam

Th 10/12 at regular class time

Final Exam

F 12/15 at noon-1:50 pm

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Weekly Schedule (Tentative)

Programing Assignment #

Out on

Due on GradeScope @11:59pm

1

F 9/8

F 9/29

2

F 9/29

F 10/20

3

F 10/20

F 11/3

4

F 11/3

F 11/17

5

F 11/17

F 12/8

 

Homework Assignment #

Out on

Due on GradeScope @11:59pm

1

F 9/1

T 9/5

2

F 9/8

T 9/12

3

F 9/15

T 9/19

4

F 9/22

T 9/26

5

F 9/29

T 10/3

6

F 10/6

T 10/17

7

F 10/13

T 10/24

8

F 10/20

T 10/31

9

F 10/27

T 11/7

10

F 11/3

T 11/14

11

F 11/10

T 11/28

12

F 11/17

T 12/5

 

Lab Assignment #

Out on

Due on GradeScope @11:59pm

1

F 9/8

F 9/15

2

F 9/15

F 9/22

3

F 9/29

F 10/6

4

F 10/20

F 10/27

5

F 11/3

F 11/10

6

F 11/17

F 12/1

 

Week

Topic

Reading

Recitation Schedule

Announcements

Wk 1

(8/28-9/1)

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

No recitation

 

Wk 2

(9/4-9/8)

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

 

Lab 1

Homework 1 due on 9/5

Assignment 1 out on 9/8

 

Spring Term add/drop period ends on 9/8

Wk 3

(9/11-9/15)

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

Lab 2

Homework 2 due on 9/12

Lab 1 due on 9/15

 

 

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

Wk 4

(9/18-9/22)

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

Assignment 1 Support

Homework 3 due on 9/19

Lab 2 due on 9/22

Wk 5

(9/25-9/29)

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

Ch. 5, 6

Lab 3

Homework 4 due on 9/26

Assignment 1 due on 9/29 @ 11:59pm

Assignment 2 out on 9/29

Wk 6

(10/2-10/6)

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

Midterm Review

Homework 5 due on 10/3

Lab 3 due on 10/6

 

Wk 7

(10/9-10/13)

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

Assignment 2 Support

Midterm exam on Thursday 10/12

Wk 8

(10/16-10/20)

Runtime analysis of recursive functions

Lab 4

Homework 6 due on 10/17

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

Assignment 3 out on Friday 10/20

 

Wk 9

(10/23-10/27)

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

Homework 7 due on 10/24

Lab 4 due on 10/27

 

Monitored Withdrawal forms due by Friday 10/27

Wk 10

(10/30-11/3)

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

Lab 5

Homework 8 due on 10/31

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

Assignment 4 out on Friday 11/3

Wk 11

(11/6-11/10)

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

Homework 9 due on 11/7

Lab 5 due on 11/10

 

Wk 12

(11/13-11/17)

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

Lab 6

Homework 10 due on 11/14

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

Assignment 5 out on Friday 11/17

 

Thanksgiving Recess for students (no classes)

Wk 13

(11/27-12/1)

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

Notes

Assignment 5 Support

Homework 11 due on 11/28

Lab 6 due on 12/1

Wk 14

(12/4-12/8)

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

 

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

Ch. 8

Final Exam Review

Homework 12 due on 12/5

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

 

 

Finals Week

(12/11-12/15)

 

Final exam on Friday 12/15 from noon to 1:50 pm

 

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. This term we will be using Piazza for class discussion. The system is highly catered to getting you help fast and efficiently from classmates, the TA, and myself. Rather than emailing questions to the teaching staff, I encourage you to post your questions on Piazza. If you have any problems or feedback for the developers, email team@piazza.com.

 

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.

 

No Use of Generative AI Permitted

 

Intellectual integrity is vital to an academic community and for my fair evaluation of your work. All work completed and/or submitted in this course must be your own, completed in accordance with the University's Guidelines on Academic Integrity. You may not engage in unauthorized collaboration or make use of ChatGPT or any other generative AI applications at any time.

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.