Lecture Notes on
Restoring Invariants
15-122: Principles of Imperative Computation
Frank Pfenning
Lecture 17
June 13, 2013
1
Introduction
In this lecture we will implement operations on heaps. The theme of this
lecture is reasoning with invariants that ar
Lecture Notes on
Union-Find
15-122: Principles of Imperative Computation
Frank Pfenning
Lecture 27
April 28, 2011
1
Introduction
Kruskals algorithm for minimum weight spanning trees starts with a collection of single-node trees and adds edges until it has
Amortized Analysis
Victor Adamchik
Amortized analysis gives the average performance (over time) of each operation in the
worst case. In a sequence of operations the worst case does not occur often in each operation some operations may be cheap, some may b
Lecture Notes on
Spanning Trees
15-122: Principles of Imperative Computation
Frank Pfenning
Lecture 25
April 26, 2011
1
Introduction
In this lecture we introduce graphs. Graphs provide a uniform model for
many structures, for example, maps with distances
Lecture Notes on
Generic Data Structures
15-122: Principles of Imperative Computation
Frank Pfenning
Lecture 24
April 7, 2011
1
Introduction
Using void* to represent pointers to values of arbitrary type, we were able
to implement generic stacks in that th
Lecture Notes on
Memory Management
15-122: Principles of Imperative Computation
Frank Pfenning
Lecture 21
April 5, 2011
1
Introduction
Unlike C0 and other modern languages like Java, C#, or ML, C requires programs to explicitly manage their memory. Alloca
Lecture Notes on
Tries
15-122: Principles of Imperative Computation
Thomas Cortina
Notes by Frank Pfenning
Lecture 24
April 19, 2011
1
Introduction
In the data structures implementing associative arrays so far, we have needed
either an equality operation
Lecture Notes on
AVL Trees
15-122: Principles of Imperative Computation
Frank Pfenning
Lecture 18
March 22, 2011
1
Introduction
Binary search trees are an excellent data structure to implement associative arrays, maps, sets, and similar interfaces. The ma