Lecture calendar

                  LecturesReading and Materials
Week 1

Slides 1 (Weeks 1–4) | Slides 2 (Weeks 5+)

Lec 1 (Jan 5): [Video] First C program, printf, variables, scanf, compilation with gcc

Lec 2 (Jan 7): [Video] Pointers (&, *), arrays, pass by pointer

Lec 3 (Jan 8): [Video] Memory model, pointer arithmetic, sizeof, exercises

Reading: King Ch. 1–2 (Introducing C, C Fundamentals); Ch. 11 (Pointers); Ch. 8 §8.1–8.2 (Arrays); Ch. 12 §12.1–12.3 (Pointers and Arrays); Ch. 9 §9.1–9.3 (Functions). Lecture notes: Hello World, Data Types, Pointers, Arrays

Learning outcomes: Run basic C programs. Begin understanding the C memory model. Use pointers and arrays.

Week 2

Lec 4 (Jan 12): [Video] const pointers, strings as char arrays, null terminator

Lec 5 (Jan 14): [Video] Pointer drills, pointers to pointers, printf format specifiers

Lec 6 (Jan 15): [Video] typedef, structs, pointers to structs (. vs ->), malloc

Reading: King Ch. 13 §13.1–13.5 (Strings); Ch. 3 (Formatted I/O); Ch. 17 §17.6 (Pointers to Pointers); Ch. 16 §16.1–16.2 (Structures); Ch. 17 §17.1 (Dynamic Storage Allocation). Lecture notes: Strings, Pointers, Structs

Learning outcomes: Develop a better understanding of the C memory model. Use strings, structs, and malloc.

Week 3

Lec 7 (Jan 19): [Video] sizeof on structs, arrays vs memory blocks, free, pointer drills

Lec 8 (Jan 21): [Video] Pointer drill practice: types, aliasing, arrays and blocks

Lec 9 (Jan 22): [Video] Struct drills: strcpy, strings in structs, arrays of structs

Reading: King Ch. 17 §17.1–17.4 (Dynamic Storage, Deallocating); Ch. 16 §16.3 (Nested Arrays and Structures); Ch. 11–12 (Pointers, Pointers and Arrays); Ch. 13 §13.5 (C String Library). Lecture notes: Structs, Pointers, Strings

Learning outcomes: Use C pointers together with structs and memory blocks, including passing to and from functions.

Week 4

Lec 10 (Jan 26): [Video] Malloc'd blocks of structs, blocks of addresses (student **), char * vs char[]

Lec 11 (Jan 28): [Video] When strcpy crashes, const char *, create_student / destroy_student

Lec 12 (Jan 29): [Video] Systematic drill: pass by value vs pointer for all three struct types

Reading: King Ch. 17 §17.1–17.4 (Dynamic Allocation, Deallocating); Ch. 17 §17.6 (Pointers to Pointers); Ch. 13 §13.2 (String Variables); Ch. 9 §9.3 (Arguments); Ch. 11 §11.4 (Pointers as Arguments). Lecture notes: Structs, Functions

Learning outcomes: Dynamically allocate structs with string fields. Understand create/destroy patterns and pass-by-value vs pass-by-pointer.

Week 5

Lec 13 (Feb 2): [Video] Valgrind, header files (.h / .c, guards), starting my_string

Lec 14 (Feb 4): [Video] Completing my_string: append, destroy, aliasing

Lec 15 (Feb 5): [Video] ++ with pointer arithmetic, ADTs vs data structures, Stack ADT (Python only)

Reading: King Ch. 15 §15.1–15.2 (Source Files, Header Files); Ch. 17 §17.2–17.4 (Dynamic Strings, Deallocating); Ch. 13 §13.5–13.6 (String Library, Idioms); Ch. 4 §4.3 (Increment/Decrement); Ch. 12 §12.1 (Pointer Arithmetic); Ch. 19 §19.1–19.4 (Modules, ADTs, Stack ADT). Lecture notes: Better Strings in C, ADTs, Stacks, Projects & GCC

Learning outcomes: Use Valgrind and header files. Implement a string ADT with dynamic memory. Understand abstract data types.

Week 6

Lec 16 (Feb 9): [Video] ArrayList ADT: append, insert, get, delete; realloc

Lec 17 (Feb 11): [Video] qsort (comparator functions, sorting structs); midterm review

Lec 18 (Feb 12): [Video] Midterm review: file parsing, two-pass reading, dot vs arrow drill

Reading: King Ch. 17 §17.3 (Dynamically Allocated Arrays); Ch. 19 §19.3–19.5 (ADTs, Design Issues); Ch. 17 §17.7 (Pointers to Functions); Ch. 26 §26.2 (<stdlib.h>, qsort); Ch. 22 §22.1–22.5 (Streams, File Operations, Line I/O). Lecture notes: ADTs

Learning outcomes: Implement a resizable array. Use qsort with custom comparators. Read and parse files in C.

Week 7

Lec 19 (Feb 23): [Video] Linked lists: node and LL structs, create_node, create_LL_from_data, append, confirm size, get (iterative and recursive)

Lec 20 (Feb 25): [Video] Python classes: __init__, methods, self; C struct equivalence; operator overloading (__add__, __getitem__, __setitem__, __repr__); mutable string class

Lec 21 (Feb 26): [Video] Stack and queue ADTs; stack and queue via wrapped list; complexity (push amortized O(1), dequeue O(n)); amortized cost; linked list in Python with tail pointer (prepend, append, pop_head, __getitem__, __repr__)

Reading: Linked list notes, Classes

Learning outcomes: Understand linked list structure and operations. Implement append, get, insert, delete. Write recursive linked list functions. Use Python classes with __init__, methods, and operator overloading.

Week 8

Lec 22 (Mar 2): [Video] Graphs: vertices, edges, directed/undirected/weighted; terminology (adjacent, path, cycle, DAG, degree, connected component); adjacency matrix representation with numpy

Lec 23 (Mar 4): [Video] Adjacency matrix airport example; random walk on a graph (np.where, np.random.choice); adjacency list with Node objects; complexity comparison (space, edge lookup, get neighbours)

Lec 24 (Mar 6): [Video] Graph traversal: BFS (iterative, queue), DFS (iterative, stack); pop(0) vs pop(); recursive DFS; call stack; why recursive BFS is not natural

Reading: Graph notes, Graph traversal notes

Learning outcomes: Understand graph terminology. Implement graphs using adjacency matrices and adjacency lists. Compare space and time complexity of both representations. Implement BFS and DFS iteratively and recursively.

Week 9

Lec 25 (Mar 9): [Video] PageRank: random walk on a graph, transition matrix, Mkv convergence, steady state as eigenvector (Mv=v); graphs and recursive DFS in C (structs, malloc/realloc/calloc, find_index)

Lec 26 (Mar 11): [Video] Dynamic programming: memoization (Fibonacci), bottom-up DP; painting houses problem (subproblems, recurrence, backtracking); making change preview. Slides

Lec 27 (Mar 12): [Video] Painting houses code walkthrough and backtracking; making change with DP (bottom-up + recovery)

Reading: Graph notes, Dynamic programming notes

Learning outcomes: Understand PageRank as a random walk and eigenvector computation. Translate Python graph and DFS code to C using structs and dynamic memory. Apply dynamic programming to optimization problems.

Week 10

Lec 28 (Mar 16): [Video] Recursive min_coins and memoization; making change with recovery; seam carving algorithm (DP on images)

Lec 29 (Mar 18): [Video] Seam carving as shortest path; priority queues; Dijkstra's algorithm (step-by-step walkthrough, correctness, complexity). Slides

Lec 30 (Mar 19): [Video] Introduction to neural networks; supervised machine learning (training/test sets, parameterized functions); gradient descent; 1-nearest neighbors; simple neural network for face recognition; language models preview. Slides

Reading: Dynamic programming notes

Practice: LeetCode Dynamic Programming problems (easy + medium)

Learning outcomes: Understand recursive vs bottom-up DP. Recover optimal solutions via backtracking. Apply DP to seam carving (2D generalization of painting houses). Understand the supervised machine learning framework (training/test sets, parameterized functions). Implement gradient descent to minimize a cost function. Understand 1-nearest neighbors and distance measures. Know the structure of a simple single-layer neural network. Understand how autoregressive language models generate text.

Week 11

Lec 31 (Mar 23): [Video] Gradient descent review (1D and multidimensional); why LLMs work (in-context learning, chain of thought, tool use and agents); Linux tools (cat, grep, redirection); deep neural networks (hidden layers, multiple templates, weight visualization). Slides

Lec 32 (Mar 25): [Video] Deep neural networks (cont'd): templates review, multiple hidden layers (templates over templates); visualizing hidden units (Zeiler & Fergus layers 3–5); deep NNs as a model of computation (powerful + learnable); the deep learning hypothesis; 1-nearest neighbors exam question; agentic coding demo with Claude Code. Slides

Lec 33 (Mar 26): [Video] Occam’s razor and the octopus (Bender & Koller 2020); epicycles to Newton to Einstein; can AI learn physics?; Dijkstra review; best-first search; A* algorithm (grid demo, chess, math exams as graph search)

Reading: 3Blue1Brown neural networks playlist; A* introduction (Red Blob Games)

Learning outcomes: Understand why hidden layers improve neural network performance (multiple templates). Visualize and interpret learned weight matrices. Know how in-context learning, chain of thought, and tool use improve LLM capabilities. Understand the agent loop (generate, run, observe, fix). Understand how deeper layers in a neural network activate on increasingly abstract categories. Know the deep learning hypothesis and why deep neural networks are both powerful and learnable. Implement 1-nearest neighbors for image classification. Understand the Occam’s razor argument for why neural networks might learn concise theories. Know the difference between Dijkstra, best-first search, and A*. Understand how A* applies to chess and math proofs. Understand how A* applies beyond pathfinding (chess, math proofs).

Week 12

Lec 34 (Mar 30): [Video] Dijkstra and A* Python implementation (weighted graph class, name_to_node, heapq, haversine heuristic); binary search trees (set/map ADTs, look-up in O(log n), worst case, AVL/red-black trees)

Lec 35 (Apr 1): [Video] April Fools (patch.c: functions are stored as data); tree terminology review; building a BST in Python; search_BST and insert_BST; BST for sets; BST for dictionaries (tree map: get_value_by_key, insert_map); comparison with sorted lists

Lec 36 (Apr 2): [Video] patch.c follow-up; map ADT review; "dumb" array map (live demo: str_to_int, ArrayMap); hash tables (hash functions for integers/strings/compound objects, primes); collisions; separate chaining (buckets, load factor, rehashing); probing (linear, quadratic, double hashing). Hash table slides

Reading: Shortest paths & Dijkstra notes, A* notes; A* introduction (Red Blob Games); Hash tables notes

Learning outcomes: Implement Dijkstra and A* in Python using a priority queue. Understand the weighted graph class with name_to_node dictionary. Implement A* with a heuristic function (haversine). Understand binary search trees: structure, look-up algorithm, O(log n) complexity for balanced trees, O(n) worst case. Implement the Map ADT using a BST. Understand hash tables: hash functions, collisions, separate chaining, load factor, and rehashing.

Week 13

Lec 37 (Apr 6): [Video] Hash table with separate chaining in C, live‑coded from the given linked list interface (linkedlist.h | linkedlist.c | hashtable.h | hashtable.c): ht_create (calloc for NULL buckets), ht_hash (string → index using powers of 17), ht_put/ht_get, ht_destroy (destroy each chain, then the table, then the struct); strdup; compiling with -lm; debugging the list_insert return‑value bug. Walk‑through of last year's exam (Q1–Q10) and what's fair game for runtime complexity; exam preparation strategy (do labs and projects from scratch, do a past exam on paper with a timer).

Learning outcomes: Implement a hash table with separate chaining in C using linked lists. Use strdup, calloc, and strcmp for string-based key-value storage. Understand how the hash table delegates to linked list operations. Reason about why list_insert must return the new head, and why ht_destroy requires calling list_destroy on each bucket rather than just freeing pointers. Know what is and isn't fair to ask about runtime complexity on the exam.