ICS 46 Spring 2022
Notes and Examples


Notes and examples, from lecture and otherwise

Over the course of the quarter, I'll be providing notes and commented code examples for you, on all of the topics that we cover in the course. When we write code in lecture, you can assume that they will be turned into full-scale code examples and be posted here afterward; for other topics, I'll write up a detailed set of lecture notes. I'd like to turn these into something complete and instructive — and this process takes some time, so it's best, in general, not to expect these to be available right away, but I will generally try to have them available before the next lecture, at the latest.

Note that you are not permitted to simply copy and paste this code into your own projects, but, of course, the techniques employed may also be of general use to you in your work. These examples are intended to give you clean, well-documented examples of some of the things we cover in lecture (and possibly a few things that we don't, time permitting), so that you can be free in lecture to avoid trying to take detailed notes when we're writing code together, instead concentrating on understanding the process and the bigger-picture concepts at work.

Lecture Week Description
Week 1 Course Introduction
Week 1 Contracts and Exceptions
Week 1 Templates
Week 2 Randomness
Week 2 Smart Pointers
Week 2 Multidimensional Data
Week 3 Move Semantics
Week 3 Asymptotic Analysis
Week 3 Linked List Variations
Week 3 Stacks, Queues, and Deques
Week 3 Amortized Analysis
Week 4 Asymptotic Analysis of Recursion
Week 4 General Trees
Week 4 Tree Traversals
Week 4 N-ary and Binary Trees
Week 5 Binary Search Trees
Week 5 AVL Trees
Week 5 Skip Lists
Week 6 Hash Tables
Week 6 Priority Queues
Week 6 Graphs
Week 7 Graph Traversals
Week 7 Graph Connectedness
Week 7 Graphs: Shortest Paths
Week 7 Graphs: Toplogical Ordering
Week 8 Comparison-Based Sorting
Week 9 Linear-Time Sorting
Week 9 The Union-Find Algorithm


Useful C++ background

The Notes and Examples from my most recent offering of ICS 45C provide a lot of background on topics that you'll need in this course. If you feel like any of your knowledge is shaky — because some particular topic didn't sink in when you took ICS 45C, or because it's been a while and you've forgotten some of the material — you'll find those notes to be a good way to get back into the swing of things.