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 04 Introduction and OOP [ pdf | code ]
Course administrivia. Designing Java classes. Designing data structures. Object oriented programming.
L01 Wed, Jan 06 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 07
L02 Fri, Jan 08 Basic Data Structure Trade-Offs [ code ]
Lists. Sets. Maps. Nested data structures. Efficiency.
L03 Mon, Jan 11 Implementation: ArrayIntList [ code ]
Arrays. Implementing an ArrayList. Designing a class to fit an API.
Project01 (ciphers) due @ 11:30 pm on Mon, Jan 11
L04 Wed, Jan 13 Generics and Implementation: ArrayList [ code ]
Generics. Java types. Interfaces.
Lab02 (adventure) due @ 11:30 pm on Thu, Jan 14
L05 Fri, Jan 15 Iterators and Implementation: SimpleArraySet, SimpleSortedArraySet [ code ]
Iterators. Implementing a set. Data structure trade-offs.
:( Mon, Jan 18 No Class: MLK Day
Project02 (hangman) due @ 11:30 pm on Mon, Jan 18
:( Tue, Jan 19 No Lab: Mental Health Break!
L06 Wed, Jan 20 Stacks, Queues, and Implementation: LinkedList [ pdf | code ]
Collections. Stacks. Queues. Nodes. Implementing a linked list.
L07 Fri, Jan 22 The Power of Recursion [ pdf | code ]
RECURSION
L08 Mon, Jan 25 Trees and BSTs [ pdf ]
The tree data structure. Binary search trees.
Project03 (synthesizer) due @ 11:30 pm on Mon, Jan 25
L09 Wed, Jan 27 Tries [ code ]
The trie data structure.
Lab04 (decision trees) due @ 11:30 pm on Thu, Jan 28
L10 Fri, Jan 29 Recursive Backtracking [ pdf ]
More tries. The recursive backtracking pattern.
L11 Mon, Feb 01 Asymptotic Analysis [ pdf ]
How do we measure "efficiency" of code? What does it mean for an algorithm to be "more efficient" than another one?
Project04 (movies) due @ 11:30 pm on Mon, Feb 01
L12 Wed, Feb 03 We're Now In Person Starting Next Lecture!
Lab05 (anagrams) due @ 11:30 pm on Thu, Feb 04
L13 Fri, Feb 05 Hash Tables I [ pdf ]
The hashtable data structure.
L14 Mon, Feb 08 Hash Tables II [ pdf ]
More hashtables. Collision resolution. Rehashing.
:( Tue, Feb 09 No Lab!
L15 Wed, Feb 10 Hash Tables III [ pdf ]
More hashtables.
L16 Fri, Feb 12 Heaps & Priority Queues I [ pdf ]
The heap data structure.
:( Mon, Feb 15 No Class: President's Day
Project05 (markov) due @ 11:30 pm on Mon, Feb 15
:( Wed, Feb 17 No Class: Blackouts
Lab07 (grundy) due @ 11:30 pm on Thu, Feb 18
L17 Fri, Feb 19 Heaps & Priority Queues II
The heap data structure, part 2.
L18 Mon, Feb 22 Interlude
L19 Wed, Feb 24 Interlude: P & N Positions and Nim [ pdf ]
Combinatorial Game Theory!
Lab08 (pebbling) due @ 11:30 pm on Thu, Feb 25
L20 Fri, Feb 26 Graphs I: Representation [ pdf ]
L21 Mon, Mar 01 Graphs II: DAGs [ pdf ]
Project06 (chat) due @ 11:30 pm on Mon, Mar 01
L22 Wed, Mar 03 Graphs III: Single-Source Shortest Paths
Lab09 (dfs) due @ 11:30 pm on Thu, Mar 04
L23 Fri, Mar 05 Sorting
L24 Mon, Mar 08 Partizan Games, Minimax, and Alphabeta
L25 Wed, Mar 10 Victory Lap
Lab10 (steganography) due @ 11:30 pm on Thu, Mar 11
Project07 (maps) due @ 11:30 pm on Fri, Mar 12
Project08 (othello) due @ 11:30 pm on Fri, Mar 12