Question: Write a Java program which takes as input the name of a file in the current directory. The first line of the file will contain



Write a Java program which takes as input the name of a file in the current directory. The first line of the file will contain an integer n, giving the number of posts along the river. The remaining n - 1 lines of the file will contain the integers of the cost matrix, delimited by white space, omitting the unnecessary entries. For example, the matrix shown above could be represented by the following data file: 4 10 15 50 40 20 35 (Note that white space is not significant in the file.)Using a dynamic programming algorithm, your program will then compute the optimal costs of traveling between any two posts (2', j) where i
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
