Welcome to CS 2! We’re super excited to have you here this term!
Please fill out the course survey. We will use this to facilitate several important aspects of CS 2. Note that you will have to log in with your Caltech account to fill in the survey.
Lectures for the first two weeks will be on Zoom. You can click here to get the Zoom link (and other course related private links).
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.
The following is a list of handouts that you might find helpful throughout the course. We’ve categorized them by when they are useful.
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
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
|L00||Mon, Jan 03||
Introduction and OOP
[ pdf |
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||
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
Lists. Sets. Maps. Nested data structures. Efficiency.
|L03||Mon, Jan 10||
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:
Generics. Java types. Interfaces.
|Lab02 (adventure) due @ 11:30 pm on Thu, Jan 13|
|L05||Fri, Jan 14||
Iterators and Implementation:
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:
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 |
|L08||Mon, Jan 24||
Trees and BSTs
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||
The trie data structure.
|L10||Fri, Jan 28||
More tries. The recursive backtracking pattern.
|L11||Mon, Jan 31||
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
The hashtable data structure.
|L14||Mon, Feb 07||
Hash Tables II
More hashtables. Collision resolution. Rehashing.
|Project04 (autocorrect) due @ 11:30 pm on Mon, Feb 07|
|:D||Tue, Feb 08||
Lab05: Anagrams [ spec ]
|L15||Wed, Feb 09||
Hash Tables III
|Lab05 (anagrams) due @ 11:30 pm on Thu, Feb 10|
|L16||Fri, Feb 11||
Heaps & Priority Queues I
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
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|