Find Jobs
Hire Freelancers

Data Structures Homework

$30-5000 USD

已完成
已发布超过 20 年前

$30-5000 USD

货到付款
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 Java
项目 ID: 3026476

关于此项目

6提案
远程项目
活跃20 年前

想赚点钱吗?

在Freelancer上竞价的好处

设定您的预算和时间范围
为您的工作获得报酬
简要概述您的提案
免费注册和竞标工作
颁发给:
用户头像
See private message.
$10 USD 在3天之内
4.9 (195条评论)
5.7
5.7
6威客以平均价$29 USD来参与此工作竞价
用户头像
See private message.
$22.95 USD 在3天之内
4.9 (48条评论)
3.8
3.8
用户头像
See private message.
$85 USD 在3天之内
4.7 (15条评论)
3.8
3.8
用户头像
See private message.
$17 USD 在3天之内
5.0 (9条评论)
3.4
3.4
用户头像
See private message.
$29.75 USD 在3天之内
3.8 (4条评论)
2.3
2.3
用户头像
See private message.
$8.50 USD 在3天之内
0.0 (0条评论)
0.0
0.0

关于客户

UNITED STATES的国旗
United States
5.0
3
会员自12月 4, 2003起

客户认证

谢谢!我们已通过电子邮件向您发送了索取免费积分的链接。
发送电子邮件时出现问题。请再试一次。
已注册用户 发布工作总数
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
加载预览
授予地理位置权限。
您的登录会话已过期而且您已经登出,请再次登录。