CS 2 (Winter 2025)

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

Most Recent Announcements

Due Next

Office Hours Status

Calendar

Wellness and Inclusion

It is very important to us that you succeed in CS 2. We provide many extra resources to help you. Prof. Blank 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 Prof. Blank 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 Extension Requests

Course Staff

Instructors

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

Teaching Assistants

Hopper
she/her
hopper@
Vansh Tibrewal
he/him
vtibrewa@
Aiden Di Carlo
he/him
adicarlo@
Ellie Chen
any/all
echen2@
Jinhuang (Jin) Zhou
he/him
jzhou2@
Maya Keys
she/her
mekeys@
Max Chen
he/him
mfchen@
Pratyush Singh
he/him
pksingh@
Ritali Jain
she/her
rjain@
Robert Reiden Walker
he/they
rrwalker@
Ryan Lin
he/him
rylin@
Sani Deshmukh
she/her
sadeshmu@

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

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 Mon, Jan 06 Introduction and OOP [ materials ]
Course administrivia. Designing Java classes. Designing data structures. Object oriented programming.
L01 Fri, Jan 10 Java Practice!
Practice…writing code in Java.
L02 Mon, Jan 13 Problem Decomposition
Using an API. Helper methods. Quadgrams. Log likelihoods. Java String API. Reading documentation.
L03 Wed, Jan 15 Basic Data Structure Trade-Offs
Lists. Sets. Maps. Nested data structures. Efficiency.
DUE Thu, Jan 16
11:30 pm
lab01 (explosive-debugging) [ guide ]
Debugging JUnit tests. Prints. The IntelliJ debugger. Breakpoints.
L04 Fri, Jan 17 Regular Expressions
Strings, parsing, and regular expressions.
DUE Mon, Jan 20
11:30 pm
project01 (ciphers) [ guide ]
This project helps us transition fully over to Java.
L05 Wed, Jan 22 ADTs, Stacks, and Queues
How do we characterize data structures? Client usage of stacks and queues.
DUE Thu, Jan 23
11:30 pm
lab02 (memory)
Memory model. References. Linked Lists. Recursion.
L06 Fri, Jan 24 Implementation: ArrayIntList
Arrays. Implementing an ArrayList. Designing a class to fit an API.
L07 Mon, Jan 27 Generics and Implementation: ArrayList
Generics. Java types. Interfaces.
DUE Mon, Jan 27
11:30 pm
project02 (hangman)
This project focuses on using the built-in Java collections as a client.
DUE Tue, Jan 28
11:30 pm
quiz01
L08 Wed, Jan 29 Iterators and Implementation: SimpleArraySet, SimpleSortedArraySet
Iterators. Implementing a set. Data structure trade-offs.
L09 Fri, Jan 31 Stacks and Queues Implementation: LinkedList
Collections. Stacks. Queues. Nodes. Implementing a linked list.
L10 Mon, Feb 03 The Power of Recursion
RECURSION
DUE Mon, Feb 03
11:30 pm
project03 (html fixer)
This project focuses on algorithmic efficiency and using stacks and queues.
L11 Wed, Feb 05 More Recursion
DUE Thu, Feb 06
11:30 pm
lab03 (tradeoffs)
Data structure trade-offs. Efficiency.
L12 Fri, Feb 07 Trees and BSTs
The tree data structure. Binary search trees.
L13 Mon, Feb 10 Tries
The trie data structure.
DUE Mon, Feb 10
11:30 pm
project04 (synthesizer)
This project focuses on building our own data structures for the first time.
L14 Wed, Feb 12 Recursive Backtracking
More tries. The recursive backtracking pattern.
DUE Thu, Feb 13
11:30 pm
lab04 (huffman)
Recursive backtracking. Trees.
L15 Fri, Feb 14 Hash Tables I
The hashtable data structure.
DUE Mon, Feb 17
11:30 pm
project05 (movies)
This project focuses on implementing the trie data structure, and creating an extensible API.
L16 Wed, Feb 19 Hash Tables II
More hashtables. Collision resolution. Rehashing.
DUE Thu, Feb 20
11:30 pm
lab05 (memoization)
Memoization. Recurrence Relations.
L17 Fri, Feb 21 Asymptotic Analysis I: Big-Theta
L18 Mon, Feb 24 Asymptotic Analysis II: Recurrences
DUE Tue, Feb 25
11:30 pm
quiz02
L19 Wed, Feb 26 Graphs I: Representation
L20 Fri, Feb 28 Graphs II: DAGs
L21 Mon, Mar 03 Heaps & Priority Queues I
The heap data structure.
DUE Mon, Mar 03
11:30 pm
project06 (beavermaps)
This project focuses on building and using a graph data structure.
L22 Wed, Mar 05 Graphs III: Single-Source Shortest Paths
DUE Thu, Mar 06
11:30 pm
lab06 (mazes)
Solving mazes. DFS.
L23 Fri, Mar 07 Sorting
L24 Mon, Mar 10 A Case Study: Union-Find
L25 Wed, Mar 12 What's Next?
DUE Thu, Mar 13
11:30 pm
lab07 (graphs)
Traversing graphs. Social networks.