Jump to content

Matrix chain multiplication: Difference between revisions

m
→‎{{header|Go}}: more accurate code comment
(Add Go solution.)
m (→‎{{header|Go}}: more accurate code comment)
Line 318:
func newSquareMatrices(n int) (m, s [][]int) {
// Allocates two n×n matrices as slices of slices but
// using only one [n2n][]int and one [n2n²]int backing array.
m = make([][]int, 2*n)
m, s = m[:n:n], m[n:]
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.