CS 2 (Winter 2023)

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, and we have a Ticketing System where you can ask questions asynchronously.

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 Ticketing System Late Tokens Grades

Course Staff

Instructor

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

Teaching Assistants

Hopper
she/her
hopper@
James Bowden
he/him
jbowden@
Snigdha Saha
she/her
snigdha@
Antonio Caceres
he/they
acaceres@
Aditi Chandrashekar
she/her
ajchandr@
Alice Cheng
she/her
aycheng@
Bruno Freeman
he/him
bfreeman@
Devin Chotzen-Hartzell
he/him
dchotzen@
Eshani Patel
she/her
ejpatel@
Enoch Luk
he/him
eluk@
Esmir Mesic
he/him
esmir@
Isha Chakraborty
she/her
isha@
Jon Corrales
he/him
jcorrale@
Jun Hyuk Kwak
he/him
jkwak@
Jia Yue Wu
she/her
jwu7@
Leo Jenkins
he/him
lbjenkin@
Leo Zhang
he/him
lzhang3@
Markus Lendermann
he/him
mlenderm@
Nico Adamo
he/him
nadamo@
Randy Ngo
he/him
randy@
Sahil Azad
he/him
sazad@
Saumya Chauhan
she/her
schauhan@
Sarah Dunbar
she/her
sdunbar@
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

Recursion

Recursion Template – a template to help write recursive functions

Schedule

L00 Wed, Jan 04 Introduction and OOP [ pdf | code ]
Course administrivia. Designing Java classes. Designing data structures. Object oriented programming.
L01 Fri, Jan 06 Problem Decomposition [ code ]
Using an API. Helper methods. Quadgrams. Log likelihoods. Java String API. Reading documentation.
L02 Mon, Jan 09 Basic Data Structure Trade-Offs [ code ]
Lists. Sets. Maps. Nested data structures. Efficiency.
Project01 (ciphers) [ guide ] due @ 11:30 pm on Mon, Jan 09
:D Tue, Jan 10 Lab01: Explosive Debugging [ guide ]
Debugging JUnit tests. Prints. The IntelliJ debugger. Breakpoints.
L03 Wed, Jan 11 Implementation: ArrayIntList [ pdf | code ]
Arrays. Implementing an ArrayList. Designing a class to fit an API.
Lab01 (debugging) [ guide ] due @ 11:30 pm on Thu, Jan 12
L04 Fri, Jan 13 Generics and Implementation: ArrayList [ code ]
Generics. Java types. Interfaces.
:( Mon, Jan 16 No Class: MLK Day
Project02 (hangman) [ guide ] due @ 11:30 pm on Mon, Jan 16
:D Tue, Jan 17 Lab02: Adventure Game [ guide ]
Reading stack traces. Using the IntelliJ Visualizer for debugging.
L05 Wed, Jan 18 Iterators and Implementation: SimpleArraySet, SimpleSortedArraySet [ code ]
Iterators. Implementing a set. Data structure trade-offs.
Lab02 (adventure) [ guide ] due @ 11:30 pm on Thu, Jan 19
L06 Fri, Jan 20 Stacks, Queues, and Implementation: LinkedList [ pdf | code ]
Collections. Stacks. Queues. Nodes. Implementing a linked list.
L07 Mon, Jan 23 The Power of Recursion [ pdf | code ]
RECURSION
:( Tue, Jan 24 No Lab!
L08 Wed, Jan 25 Cancelled
L09 Fri, Jan 27 Trees and BSTs [ pdf ]
The tree data structure. Binary search trees.
L10 Mon, Jan 30 Tries [ code ]
The trie data structure.
Project03 (synthesizer) [ guide ] due @ 11:30 pm on Mon, Jan 30
:D Tue, Jan 31 Lab03: Decision Trees [ guide ]
N-ary trees. Basic machine learning.
L11 Wed, Feb 01 Recursive Backtracking [ pdf ]
More tries. The recursive backtracking pattern.
Lab03 (decision trees) [ guide ] due @ 11:30 pm on Thu, Feb 02
L12 Fri, Feb 03 More Recursion
More recursion on trees practice.
L13 Mon, Feb 06 Hash Tables I
The hashtable data structure.
Project04 (movies) [ guide ] due @ 11:30 pm on Mon, Feb 06
:D Tue, Feb 07 Lab04: Anagrams
Recursive backtracking.
L14 Wed, Feb 08 Hash Tables II
More hashtables. Collision resolution. Rehashing.
Lab04 (anagrams) due @ 11:30 pm on Thu, Feb 09
L15 Fri, Feb 10 Heaps & Priority Queues I
The heap data structure.
L16 Mon, Feb 13 Heaps & Priority Queues II
The heap data structure, part 2.
:( Tue, Feb 14 No Lab!
L17 Wed, Feb 15 Interlude
L18 Fri, Feb 17 Interlude: P & N Positions and Nim
Combinatorial Game Theory!
:( Mon, Feb 20 No Class: Presidents' Day
Project05 (markov) due @ 11:30 pm on Mon, Feb 20
:D Tue, Feb 21 Lab05: Grundy's Game
Memoization and Games!
L19 Wed, Feb 22 Graphs I: Representation
Lab05 (grundy) due @ 11:30 pm on Thu, Feb 23
L20 Fri, Feb 24 Graphs II: DAGs
L21 Mon, Feb 27 Graphs III: Single-Source Shortest Paths
Project06 (chat) due @ 11:30 pm on Mon, Feb 27
:D Tue, Feb 28 Lab06: Pebbling
Graphs and Games!
L22 Wed, Mar 01 Sorting
Lab06 (pebbling) due @ 11:30 pm on Thu, Mar 02
L23 Fri, Mar 03 Partizan Games, Minimax, and Alphabeta
L24 Mon, Mar 06 Alphabeta and Zobrist Hashing
:D Tue, Mar 07 Lab07: Mazes
Mazes and DFS!
L25 Wed, Mar 08 Monte-Carlo Tree Search
Lab07 (mazes) due @ 11:30 pm on Thu, Mar 09
L26 Fri, Mar 10 Victory Lap
Project07 (maps) due @ 11:30 pm on Fri, Mar 10
Project08 (othello) due @ 11:30 pm on Thu, Mar 16