不知道为什么但字体没有显示.请帮忙.
CSS(在css文件夹中):style.css:
@font-face {
font-family: Gotham;
src: url(../fonts/gothammedium.eot);
src: local('Gotham-Medium'),
url(../fonts/Gotham-Medium.ttf) format('truetype');
}
a {
font-family:Gotham,Verdana,Arial;
}
Run Code Online (Sandbox Code Playgroud) 三个食人族和三个传教士必须过河.他们的船只能容纳两个人.如果食人族的数量超过传教士,在河的两边,传教士都遇到麻烦(我不会描述结果).每个传教士和每个食人族都可以划船.六个人怎么能过河?
我找不到使用IDDFS(迭代深化深度优先搜索)和GreedyBFS(贪婪最佳优先搜索)来解决此问题的算法.如何解决这个问题的想法也会让我感到高兴.
编辑:
我在wiki上找到了IDDFS的算法:
IDDFS(root, goal)
{
depth = 0
repeat
{
result = DLS(root, goal, depth)
if (result is a solution)
return result
depth = depth + 1
}
}
DLS(node, goal, depth)
{
if (depth == 0 and node == goal)
return node
else if (depth > 0)
for each child in expand(node)
DLS(child, goal, depth-1)
else
return no-solution
}
Run Code Online (Sandbox Code Playgroud)
但我无法弄清楚DLS()中的扩展(节点)应该在我的问题中完成.这是我的Node类:
public class Node{
//x-no of missionaries
//y-no of cannibals
//z-position of boat
int x,y;
boolean z;
Node(int …Run Code Online (Sandbox Code Playgroud) java algorithm artificial-intelligence river-crossing-puzzle