Deprecated: (6.006) preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /afs/athena.mit.edu/course/6/6.006/web_scripts/fall07/wiki/includes/Sanitizer.php on line 1550

Deprecated: (6.006) preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /afs/athena.mit.edu/course/6/6.006/web_scripts/fall07/wiki/includes/Sanitizer.php on line 1550
Recitation 9 - 6.006: Introduction to Algorithms

Recitation 9

From 6.006: Introduction to Algorithms
Jump to: navigation, search

Code for number of paths

DP and memoization code for counting the number of "paths" in an n*n grid.

Here a path is like the one from the previous lecture: Start at some cell in the top, and at each row, choose a cell touching (either below, below and to the left, or below and to the right) the cell chosen in the previous row.

Matrix Chain Multiplication

Given a chain of matrices (of varying sizes) computer the optimal order to multiply them in. See CLRS 15.2 (page 331) for details.

Personal tools