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
(Difference between revisions)
Jump to: navigation, search
Line 1: Line 1:
== Code for number of paths ==
+
== Code for number of paths ==.
  
 
[http://courses.csail.mit.edu/6.006/fall07/source/dp.py DP] and [http://courses.csail.mit.edu/6.006/fall07/source/memo.py memoization] code for counting the number of "paths" in an n*n grid.  
 
[http://courses.csail.mit.edu/6.006/fall07/source/dp.py DP] and [http://courses.csail.mit.edu/6.006/fall07/source/memo.py memoization] code for counting the number of "paths" in an n*n grid.  

Revision as of 21:54, 30 January 2008

== 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