Data Structures Homework

You are given an (n x n) chessboard and you start at your location of choice (removing confusing statement) on the first row. You have to find the optimal (least-cost) path from the top of the chessboard to the bottom. cost[i][j] represents the cost of moving onto square (i,j) of the chessboard. You move down one row at each step along your path. You may move to the square immediately below you or the squares diagonally below you. That is, when you on square (i,j), you can move down to either (i+1,j), (i+1,j-1), or (i+1,j+1).

Your method optimalPath() should use dynamic programming to solve this problem. Define your recurrence equation g(i,j) (which you should represent by an int[][] in your method) to be the cost of the optimal path from the first row to location (i,j).


\ c(i,j) if i = 0 (base case, first row)

g(i,j) = <

/ <figure this part out> if i > 0 (recursive case, depends on row (i-1))


PLEASE NOTE: The ArrayLinearList containts the column numbers of the path. For the example above, the resulting ArrayLinearList will contain [2, 1, 1, 2, 3].

Use the following program shell:

package dataStructures;

class OptimalPath {

public static ArrayLinearList optimalPath(int n, int [][]cost) {


// create helper methods if you need


## Deliverables

1) Complete and fully-functional working program(s) in executable form as well as complete source code of all work done.

## Platform


Habilidades: Engenharia, Java, MySQL, PHP, Arquitetura de software, Teste de Software

Veja mais: use of data structures, structures data, statement problem example, statement problem, statement of the problem example, recursive programming example, recursive programming, recursive program example, recursive problem, recurrence problem, program problem statement, programming structures, programming data structures in c, programming data base, programming and data structures, problem structures, problem statement example, java dynamic programming, example problem statement, example of statement of the problem, example of problem statement, example of dynamic programming, dynamic programming problem, dynamic programming method, dynamic programming java code

Acerca do Empregador:
( 3 comentários ) United States

ID do Projeto: #3026476

Concedido a:


See private message.

$10 USD em 3 dias
(195 Comentários)

6 freelancers estão ofertando em média $29 para esse trabalho


See private message.

$22.95 USD in 3 dias
(48 Comentários)

See private message.

$85 USD in 3 dias
(15 Comentários)

See private message.

$17 USD in 3 dias
(9 Comentários)

See private message.

$29.75 USD in 3 dias
(4 Comentários)

See private message.

$8.5 USD in 3 dias
(0 Comentários)