CS 2 (Winter 2024)

Welcome to CS 2! We’re super excited to have you here this term!

Announcements

Due Next

Calendar

Wellness and Inclusion

It is very important to us that you succeed in CS 2. We provide many extra resources to help you. Adam and the TAs hold many office hours.

It is also very important to us that you maintain your mental wellness throughout the course. A few points are not worth losing sleep over. Everyone on the course staff is available to chat, and you can always attend office hours for a non-academic conversation if necessary. You can also visit the counseling center if you find you need help beyond the course staff. If you have a temporary health condition or permanent disability (either mental health or physical health related), you should contact accessibility services if you have not already. Additionally, if there is something we can do to make your experience better, please let us know.

Diversity, inclusion, and belonging are all core values of this course. All participants in this course must be treated with respect by other members of the community in accordance with the honor code. If you feel unwelcome or unsafe in any way, no matter how minor, we encourage you to talk to Adam or one of the Deans. We view these sorts of honor code violations as completely unacceptable, and we take them very seriously.

Tools

Project Registration Grace Count Grades

Course Staff

Instructor

they/them
Book an appointment!
Annenberg 115
blank@caltech.edu
(626) 395-1765

Teaching Assistants

Hopper
she/her
hopper@
Snigdha Saha
she/her
snigdha@
Sahil Azad
he/him
sazad@
Alice Cheng
she/her
aycheng@
Apoorva Thanvantri
she/her
athanvan@
Ava Penn
she/her
apenn2@
Brian Hu
he/him
bhu3@
Dharshini Anand
she/her
danand@
Eshani Patel
she/her
ejpatel@
Jia Yue Wu
she/her
jwu7@
Jena Alsup
she/her
jalsup@
Jun Hyuk Kwak
he/him
jkwak@
Leo Jenkins
he/him
lbjenkin@
Leo Zhang
he/him
lzhang3@
Madeline Egan
she/her
msegan@
Max Chen
he/him
mfchen@
Mia Mutadich
she/her
mmutadic@
Nilo Rivera
he/him
nrivera@
Sophia Stiles
she/her
sstiles@
Vansh Tibrewal
he/him
vtibrewa@
Winter Pearson
they/them
winter@

Handouts

The following is a list of handouts that you might find helpful throughout the course. We’ve categorized them by when they are useful.

Course

Syllabus – an overview of the course and administrative information

Pair Programming – introduction to pair programming

Collaboration Policy – the course collaboration policy

Week 0

Python2Java ‘Finger’ Exercises – some exercises to help you acclimate to Java coming from a Python world

Java/Python Comparison – a comparison of the basic syntax of Python with Java

Software Setup – instructions on how to get Java, IntelliJ, and git for the course

Schedule

L00 Wed, Jan 03 Introduction and OOP [ pdf | code ]
Course administrivia. Designing Java classes. Designing data structures. Object oriented programming.
L01 Fri, Jan 05 Problem Decomposition [ code ]
Using an API. Helper methods. Quadgrams. Log likelihoods. Java String API. Reading documentation.
L02 Mon, Jan 08 Basic Data Structure Trade-Offs [ code ]
Lists. Sets. Maps. Nested data structures. Efficiency.
Project01 (ciphers) [ guide ] due @ 11:30 pm on Mon, Jan 08
:D Tue, Jan 09 Lab01: Explosive Debugging [ guide ]
Debugging JUnit tests. Prints. The IntelliJ debugger. Breakpoints.
L03 Wed, Jan 10 Implementation: ArrayIntList [ code ]
Arrays. Implementing an ArrayList. Designing a class to fit an API.
Lab01 (debugging) [ guide ] due @ 11:30 pm on Thu, Jan 11
L04 Fri, Jan 12 Generics and Implementation: ArrayList [ code ]
Generics. Java types. Interfaces.
:( Mon, Jan 15 No Class: MLK Day
Project02 (hangman) [ guide ] due @ 11:30 pm on Mon, Jan 15
:D Tue, Jan 16 Lab02: Adventure Game [ guide ]
Reading stack traces. Using the IntelliJ Visualizer for debugging.
L05 Wed, Jan 17 Iterators and Implementation: SimpleArraySet, SimpleSortedArraySet [ code ]
Iterators. Implementing a set. Data structure trade-offs.
Lab02 (steganography) [ guide ] due @ 11:30 pm on Thu, Jan 18
L06 Fri, Jan 19 Stacks, Queues, and Implementation: LinkedList [ code ]
Collections. Stacks. Queues. Nodes. Implementing a linked list.
L07 Mon, Jan 22 The Power of Recursion
RECURSION
:D Tue, Jan 23 Lab03: Memory [ guide ]
Memory model. References. Linked Lists. Recursion
L08 Wed, Jan 24 More Recursion
Lab03 (memory) [ guide ] due @ 11:30 pm on Thu, Jan 25
L09 Fri, Jan 26 Trees and BSTs [ pdf ]
The tree data structure. Binary search trees.
L10 Mon, Jan 29 Tries [ code ]
The trie data structure.
Project03 (synthesizer) [ guide ] due @ 11:30 pm on Mon, Jan 29
:D Tue, Jan 30 Lab04: Huffman [ guide ]
Recursive backtracking. Trees
L11 Wed, Jan 31 Recursive Backtracking [ code ]
More tries. The recursive backtracking pattern.
Lab04 (huffman) [ guide ] due @ 11:30 pm on Thu, Feb 01
L12 Fri, Feb 02 CANCELLED
L13 Mon, Feb 05 CANCELLED DUE TO RAIN STORM WARNING
Project04 (movies) [ guide ] due @ 11:30 pm on Mon, Feb 05
:D Tue, Feb 06 Lab05: 20 Questions [ guide ]
Binary Trees. Serialization.
L14 Wed, Feb 07 Hash Tables I [ pdf ]
The hashtable data structure.
Lab05 (20questions) [ guide ] due @ 11:30 pm on Thu, Feb 08
L15 Fri, Feb 09 Hash Tables II [ pdf ]
More hashtables. Collision resolution. Rehashing.
L16 Mon, Feb 12 Asymptotic Analysis I: Big-Theta [ pdf ]
:D Tue, Feb 13 Lab06: Memoization [ guide ]
Memoization. Recurrence Relations.
L17 Wed, Feb 14 Asymptotic Analysis II: Recurrences [ pdf ]
Lab06 (memo) [ guide ] due @ 11:30 pm on Thu, Feb 15
L18 Fri, Feb 16 Graphs I: Representation [ pdf ]
:( Mon, Feb 19 No Class: Presidents' Day
Project05 (markov) [ guide ] due @ 11:30 pm on Mon, Feb 19
:D Tue, Feb 20 Lab07: Mazes [ guide ]
Mazes and DFS!
L19 Wed, Feb 21 Graphs II: DAGs [ pdf ]
Lab07 (dfs) [ guide ] due @ 11:30 pm on Thu, Feb 22
L20 Fri, Feb 23 What is CS 3? [ pdf ]
L21 Mon, Feb 26 Heaps & Priority Queues I [ pdf ]
The heap data structure.
:D Tue, Feb 27 Lab08: Pebbling [ guide ]
Graphs and Games!
L22 Wed, Feb 28 Graphs III: Single-Source Shortest Paths [ pdf ]
Lab08 (pebbling) [ guide ] due @ 11:30 pm on Thu, Feb 29
L23 Fri, Mar 01 Sorting [ pdf ]
L24 Mon, Mar 04 A Case Study: Union-Find [ pdf ]
Project06 (maps) [ guide ] due @ 11:30 pm on Mon, Mar 04
:D Tue, Mar 05 Lab09: Technical Interviewing [ guide ]
Solve some technical interview problems!
L25 Wed, Mar 06 What's Next?
Lab09 (interviews) [ guide ] due @ 11:30 pm on Thu, Mar 07
L26 Fri, Mar 08 Victory Lap
Project07 (graphputer) [ guide ] due @ 11:30 pm on Mon, Mar 11
Redo (project or lab redo) due @ 11:30 pm on Mon, Mar 11