CS 2 (Winter 2022)

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 Zoom

Course Staff

Instructor

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

Teaching Assistants

Hopper
she/her
hopper@
Adam Abbas
he/him
aabbas@
James Bowden
he/him
jbowden@
Alice Cheng
she/her
aycheng@
Barron Han
he/him
bshan@
Devin Chotzen-Hartzell
he/him
dchotzen@
Emily Choe
she/her
ecchoe@
Emma Gurcan
she/her
emmagurcan@
Esmir Mesic
he/him
esmir@
Isha Chakraborty
she/her
isha@
Jonathon Corrales de Oliveira
he/him
jcorrale@
Jia Yue Wu
she/her
jwu7@
Leo Jenkins
he/him
lbjenkin@
Matthew Hajjar
he/him
mhajjar@
Nishka Arora
she/her
naarora@
Neil Janwani
he/him
njanwani@
Oliver Pranis
he/him
opranis@
Patrick Rim
he/him
patrick@
Sarah Dunbar
she/her
sdunbar@
Snigdha Saha
she/her
snigdha@
Tyrone McNichols
he/him
tmcnicho@

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

Getting Help in CS 2 – a description of the course policy for questions and office hours

Pushing a new branch to Gitlab – a tutorial on making a new branch to push code when master is locked

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 Mon, Jan 03 Introduction and OOP [ pdf | code ]
Course administrivia. Designing Java classes. Designing data structures. Object oriented programming.
:D Tue, Jan 04 Lab01: Explosive Debugging [ spec ]
Debugging JUnit tests. Prints. The IntelliJ debugger. Breakpoints.
L01 Wed, Jan 05 Problem Decomposition [ code ]
Using an API. Helper methods. Quadgrams. Log likelihoods. Java String API. Reading documentation.
Lab01 (debugging) due @ 11:30 pm on Thu, Jan 06
L02 Fri, Jan 07 Basic Data Structure Trade-Offs [ code ]
Lists. Sets. Maps. Nested data structures. Efficiency.
L03 Mon, Jan 10 Implementation: ArrayIntList [ code ]
Arrays. Implementing an ArrayList. Designing a class to fit an API.
Project01 (ciphers) due @ 11:30 pm on Mon, Jan 10
:D Tue, Jan 11 Lab02: Adventure Game [ spec ]
Reading stack traces. Using the IntelliJ Visualizer for debugging.
L04 Wed, Jan 12 Generics and Implementation: ArrayList [ code ]
Generics. Java types. Interfaces.
Lab02 (adventure) due @ 11:30 pm on Thu, Jan 13
L05 Fri, Jan 14 Iterators and Implementation: SimpleArraySet, SimpleSortedArraySet [ code ]
Iterators. Implementing a set. Data structure trade-offs.
:( Mon, Jan 17 No Class: MLK Jr. Day
Project02 (hangman) due @ 11:30 pm on Mon, Jan 17
:D Tue, Jan 18 Lab03: Stegonography [ spec ]
Hidding text in images.
L06 Wed, Jan 19 Stacks, Queues, and Implementation: LinkedList [ pdf | code ]
Collections. Stacks. Queues. Nodes. Implementing a linked list.
Lab03 (stego) due @ 11:30 pm on Thu, Jan 20
L07 Fri, Jan 21 The Power of Recursion [ pdf | code ]
RECURSION
L08 Mon, Jan 24 Trees and BSTs [ pdf ]
The tree data structure. Binary search trees.
Project03 (sound) due @ 11:30 pm on Mon, Jan 24
:D Tue, Jan 25 Lab04: Decision Trees [ spec ]
N-ary trees. Basic machine learning.
L09 Wed, Jan 26 Tries [ code ]
The trie data structure.
L10 Fri, Jan 28 Recursive Backtracking [ pdf ]
More tries. The recursive backtracking pattern.
L11 Mon, Jan 31 Asymptotic Analysis [ pdf ]
How do we measure "efficiency" of code? What does it mean for an algorithm to be "more efficient" than another one?
Lab04 (ID3) due @ 11:30 pm on Mon, Jan 31
L12 Wed, Feb 02 We're Now In Person Starting Next Lecture!
L13 Fri, Feb 04 Hash Tables I [ pdf ]
The hashtable data structure.
L14 Mon, Feb 07 Hash Tables II [ pdf ]
More hashtables. Collision resolution. Rehashing.
Project04 (autocorrect) due @ 11:30 pm on Mon, Feb 07
:D Tue, Feb 08 Lab05: Anagrams [ spec ]
Recursive backtracking.
L15 Wed, Feb 09 Hash Tables III [ pdf ]
More hashtables.
Lab05 (anagrams) due @ 11:30 pm on Thu, Feb 10
L16 Fri, Feb 11 Heaps & Priority Queues I [ pdf ]
The heap data structure.
L17 Mon, Feb 14 Heaps & Priority Queues II
The heap data structure, part 2.
Project05 (markov) due @ 11:30 pm on Mon, Feb 14
L18 Wed, Feb 16 Interlude
L19 Fri, Feb 18 Interlude: P & N Positions and Nim [ pdf ]
Combinatorial Game Theory!
:( Mon, Feb 21 No Class: President's Day
:D Tue, Feb 22 Lab06: Grundy's Game [ spec ]
Memoization and Games!
L20 Wed, Feb 23 Graphs I: Representation [ pdf ]
Lab06 (grundy) due @ 11:30 pm on Thu, Feb 24
L21 Fri, Feb 25 Graphs II: DAGs [ pdf ]
L22 Mon, Feb 28 Graphs III: Single-Source Shortest Paths
Project06 (beaverchat) due @ 11:30 pm on Mon, Feb 28
:D Tue, Mar 01 Lab07: DFS [ spec ]
Mazes and DFS!
L23 Wed, Mar 02 Sorting
Lab07 (maze) due @ 11:30 pm on Thu, Mar 03
:( Fri, Mar 04 No Class: Adam @ Conference
L24 Mon, Mar 07 Partizan Games, Minimax, and Alphabeta
:D Tue, Mar 08 Lab08: Technical Interviewing [ spec ]
Solve some technical interview problems!
L25 Wed, Mar 09 Victory Lap
Project07 (beavermaps) due @ 11:30 pm on Wed, Mar 09
Project08 (othello) due @ 11:30 pm on Wed, Mar 09
Lab08 (tech) due @ 11:30 pm on Thu, Mar 10