Class RiverTravel
java.lang.Object
topics.dynamic.RiverTravel
DYNAMIC PROGRAMMING PROBLEM: CHEAPER TRAVEL ON THE RIVER
It consists on finding the minimum cost for each pair of points
- Author:
- vicegd
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidriverTravel(int[][] t, int[][] c) The dynamic programming version has a cubic complexity O(n^3)voidwriteMatrix(int[][] a) Prints one of the matrix
-
Constructor Details
-
RiverTravel
public RiverTravel()
-
-
Method Details
-
riverTravel
public void riverTravel(int[][] t, int[][] c) The dynamic programming version has a cubic complexity O(n^3)- Parameters:
t- Initial matrix of feesc- Final matrix of minimum cost for each pair of docks
-
writeMatrix
public void writeMatrix(int[][] a) Prints one of the matrix- Parameters:
a- Calculated matrix
-