摘要: 1 package main 2 3 import ( 4 "fmt" 5 ) 6 7 func LCS(a, b string) []rune { 8 var L [][]int 9 row := len(a) + 110 col := len(b) + 111 L = make([][]int, row) 12 var i, j int... 阅读全文
posted @ 2013-11-05 14:51 Sunlnx 阅读(191) 评论(0) 推荐(0) 编辑
摘要: 1 package main 2 3 import ( 4 "fmt" 5 ) 6 7 //计算矩阵链乘所需最少乘法运算数 8 func matrixChain(chain []int) int { 9 length := len(chain) - 1 //矩阵个数10 matrix := make([][]int, length) //用来存储第i... 阅读全文
posted @ 2013-11-05 14:44 Sunlnx 阅读(220) 评论(0) 推荐(0) 编辑