Class MatrixChain

java.lang.Object
com.zybooks.dsaj.text.MatrixChain

public class MatrixChain extends Object
Demonstration of dynamic programming.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static int[][]
    matrixChain(int[] d)
    Returns an n-by-n matrix such that N[i][j] represents the minimum number of multiplications to compute the product of matrix chain product Ai through Aj inclusive.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • MatrixChain

      public MatrixChain()
  • Method Details

    • matrixChain

      public static int[][] matrixChain(int[] d)
      Returns an n-by-n matrix such that N[i][j] represents the minimum number of multiplications to compute the product of matrix chain product Ai through Aj inclusive. The parameter d is an array of n+1 numbers, such that the size of the kth matrix is d[k]-by-d[k+1].