Introduction to Algorithms
6.046J/18.401J
LECTURE 10
Balanced Search Trees Red-black trees Height of a red-black tree Rotations Insertion
Prof. Erik Demaine
October 19, 2005 Copyright 2001-5 by Erik D. Demaine and Charles E. Leiserson L7.1
Balanced searc
Introduction to Algorithms Massachusetts Institute of Technology Professors Erik D. Demaine and Charles E. Leiserson
November 7, 2005
6.046J/18.410J
Handout 22
Problem Set 7
MIT students: This problem set is due in lecture on Monday, November 14, 2005.
Introduction to Algorithms Massachusetts Institute of Technology Professors Erik D. Demaine and Charles E. Leiserson
November 18, 2005 6.046J/18.410J Handout 25
Problem Set 7 Solutions
Problem 7-1. Edit distance In this problem you will write a program to
Introduction to Algorithms Massachusetts Institute of Technology Professors Erik D. Demaine and Charles E. Leiserson
November 14, 2005 6.046J/18.410J Handout 23
Problem Set 8
MIT students: This problem set is due in lecture on Monday, November 21, 2005. T
Introduction to Algorithms Massachusetts Institute of Technology Professors Erik D. Demaine and Charles E. Leiserson
November 22, 2005 6.046J/18.410J Handout 27
Problem Set 8 Solutions
Problem 8-1. No left turns Youve just stolen a brand-new Nexus Nano, b
Introduction to Algorithms Massachusetts Institute of Technology Professors Erik D. Demaine and Charles E. Leiserson
December 5, 2005 6.046J/18.410J Handout 30
Problem Set 9
MIT students: This problem set is due in lecture on Friday, December 9, 2005. The
Introduction to Algorithms Massachusetts Institute of Technology Professors Erik D. Demaine and Charles E. Leiserson
December 14, 2005 6.046J/18.410J Handout 35
Problem Set 9 Solutions
Problem 9-1. More parallel merge sort In this problem we will improve
Theoretical Computer
Science Cheat
Sheet
f (n) = O (g(n) f (n) = f ~(g(n)
f (n) = O (g(n) / (n) = o(g(n)
l im a . = a
"-'=
D efinitions iff q positive c, no such that 0 _< f(n) _< cgCn) vn >_ no. iff 3 positive c, no such that f (n) >_ co(m) >_ 0 V n >_ n
Introduction to Algorithms
6.046J/18.401J LECTURE 20
Quiz 2 Review
6.046 Staff
November 23, 2005 Copyright 2001-5 by Erik D. Demaine and Charles E. Leiserson L20.1
Introduction to Algorithms
6.046J/18.401J LECTURE 15
Dynamic Programming Longest common subsequence Optimal substructure Overlapping subproblems
Prof. Charles E. Leiserson
November 7, 2005 Copyright 2001-5 by Erik D. Demaine and Charles E. Leiserson L15.1
Introduction to Algorithms 6.046J/18.401J
LECTURE 1
Analysis of Algorithms Insertion sort Asymptotic analysis Merge sort Recurrences
Prof. Charles E. Leiserson
Copyright 2001-5 Erik D. Demaine and Charles E. Leiserson
Course information
1. 2. 3. 4. 5. 6.
Introduction to Algorithms
6.046J/18.401J LECTURE 2
Asymptotic Notation O-, -, and -notation Recurrences Substitution method Iterating the recurrence Recursion tree Master method Prof. Erik Demaine
September 12, 2005 Copyright 2001-5 Erik D. Demaine and C
Introduction to Algorithms
6.046J/18.401J LECTURE 3
Divide and Conquer Binary search Powering a number Fibonacci numbers Matrix multiplication Strassen's algorithm VLSI tree layout Prof. Erik D. Demaine
September 14, 2005 Copyright 2001-5 Erik D. Demaine
Introduction to Algorithms
6.046J/18.401J LECTURE 4
Quicksort Divide and conquer Partitioning Worst-case analysis Intuition Randomized quicksort Analysis Prof. Charles E. Leiserson
September 21, 2005 Copyright 2001-5 by Erik D. Demaine and Charles E. Leis
Introduction to Algorithms
6.046J/18.401J LECTURE 5
Sorting Lower Bounds Decision trees Linear-Time Sorting Counting sort Radix sort Appendix: Punched cards Prof. Erik Demaine
September 26, 2005 Copyright 2001-5 Erik D. Demaine and Charles E. Leiserson L5
Introduction to Algorithms
6.046J/18.401J LECTURE 6
Order Statistics Randomized divide and conquer Analysis of expected time Worst-case linear-time order statistics Analysis Prof. Erik Demaine
September 28, 2005 Copyright 2001-5 by Erik D. Demaine and Cha
Introduction to Algorithms
6.046J/18.401J LECTURE 7
Hashing I Direct-access tables Resolving collisions by chaining Choosing hash functions Open addressing Prof. Charles E. Leiserson
October 3, 2005 Copyright 2001-5 by Erik D. Demaine and Charles E. Leise
Introduction to Algorithms
6.046J/18.401J LECTURE 8
Hashing II Universal hashing Universality theorem Constructing a set of universal hash functions Perfect hashing Prof. Charles E. Leiserson
October 5, 2005 Copyright 2001-5 by Erik D. Demaine and Charles
Introduction to Algorithms Massachusetts Institute of Technology Professors Erik D. Demaine and Charles E. Leiserson
November 18, 2005 6.046J/18.410J Handout 24
Problem Set 6 Solutions
Problem 6-1. Electronic Billboard You are starting a new Electronic Bi
Introduction to Algorithms Massachusetts Institute of Technology Professors Erik D. Demaine and Charles E. Leiserson
October 31, 2005 6.046J/18.410J Handout 19
Problem Set 6
MIT students: This problem set is due in lecture on Monday, November 7, 2005. The
Introduction to Algorithms Massachusetts Institute of Technology Professors Erik D. Demaine and Charles E. Leiserson
November 4, 2005 6.046J/18.410J Handout 21
Problem Set 5 Solutions
Problem 5-1. Skip Lists and B-trees Intuitively, it is easier to nd an
Introduction to Algorithms
6.046J/18.401J LECTURE 11
Augmenting Data Structures Dynamic order statistics Methodology Interval trees Prof. Charles E. Leiserson
October 24, 2005 Copyright 2001-5 by Erik D. Demaine and Charles E. Leiserson L11.1
Dynamic orde
Introduction to Algorithms
6.046J/18.401J LECTURE 12
Skip Lists Data structure Randomized insertion With-high-probability bound Analysis Coin flipping Prof. Erik D. Demaine
October 26, 2005 Copyright 2001-5 by Erik D. Demaine and Charles E. Leiserson L11.
Introduction to Algorithms
6.046J/18.401J LECTURE 13
Amortized Analysis Dynamic tables Aggregate method Accounting method Potential method Prof. Charles E. Leiserson
October 31, 2005 Copyright 2001-5 by Erik D. Demaine and Charles E. Leiserson L13.1
How l
Introduction to Algorithms
6.046J/18.401J LECTURE 14
Competitive Analysis Self-organizing lists Move-to-front heuristic Competitive analysis of MTF
Prof. Charles E. Leiserson
November 2, 2005 Copyright 2001-5 by Erik D. Demaine and Charles E. Leiserson L1
Introduction to Algorithms
6.046J/18.401J LECTURE 15
Dynamic Programming Longest common subsequence Optimal substructure Overlapping subproblems
Prof. Charles E. Leiserson
November 7, 2005 Copyright 2001-5 by Erik D. Demaine and Charles E. Leiserson L15.1
Introduction to Algorithms
6.046J/18.401J LECTURE 16
Greedy Algorithms (and Graphs) Graph representation Minimum spanning trees Optimal substructure Greedy choice Prim's greedy MST algorithm Prof. Charles E. Leiserson
November 9, 2005 Copyright 2001-5 by
Introduction to Algorithms
6.046J/18.401J LECTURE 17
Shortest Paths I Properties of shortest paths Dijkstra's algorithm Correctness Analysis Breadth-first search Prof. Erik Demaine
November 14, 2005 Copyright 2001-5 by Erik D. Demaine and Charles E. Leise
Introduction to Algorithms
6.046J/18.401J LECTURE 18
Shortest Paths II Bellman-Ford algorithm Linear programming and difference constraints VLSI layout compaction
Prof. Erik Demaine
November 16, 2005 Copyright 2001-5 by Erik D. Demaine and Charles E. Leis
Introduction to Algorithms
6.046J/18.401J LECTURE 19
Shortest Paths III All-pairs shortest paths Matrix-multiplication algorithm Floyd-Warshall algorithm Johnson's algorithm Prof. Charles E. Leiserson
November 21, 2005 Copyright 2001-5 by Erik D. Demaine