当前位置: 技术问答>java相关
who can help me :~~~~~~~~~~
来源: 互联网 发布时间:2014-12-23
本文导语: Very glad to here from you! I have a promlem and I want your help. a puzzle like this: 0 0 0 1 0 1 0 1 0 1 1 0 0 1 1 0 1 1 0 0 1 1 0 0 1 1 1 1 1 0 0 1 0 1 1 0 0 1 0 1 0 1 1...
Very glad to here from you!
I have a promlem and I want your help.
a puzzle like this:
0 0 0 1 0 1 0 1 0
1 1 0 0 1 1 0 1 1
0 0 1 1 0 0 1 1 1
1 1 0 0 1 0 1 1 0
0 1 0 1 0 1 1 0 1
1 1 0 0 1 0 0 1 1
1 0 0 1 1 1 0 0 0
"0" means "you can pass" while "1" means "you can't pass"
Fine a shortest way out.
Write in the C language.
It's frozen me for two days and two nights.
HELP!HELP!HELP!
I have a promlem and I want your help.
a puzzle like this:
0 0 0 1 0 1 0 1 0
1 1 0 0 1 1 0 1 1
0 0 1 1 0 0 1 1 1
1 1 0 0 1 0 1 1 0
0 1 0 1 0 1 1 0 1
1 1 0 0 1 0 0 1 1
1 0 0 1 1 1 0 0 0
"0" means "you can pass" while "1" means "you can't pass"
Fine a shortest way out.
Write in the C language.
It's frozen me for two days and two nights.
HELP!HELP!HELP!
|
这是一个典型的迷宫问题,说明白啦,就是一个深度优先的搜索问题,基本回溯法思想,使用递归算法实现。
大致算法说明如下:你先定义一个方向,按这个方向一直找下去,直到没有路可走,此时退一步,换一个新的方向,重复上述步骤,直到找到出口为止。
源程序我有,但是是一个有向图的最短路径的搜索算法,基本上差不多,你感兴趣的话,我可以给你。
我的OICQ号码为:33360291
大致算法说明如下:你先定义一个方向,按这个方向一直找下去,直到没有路可走,此时退一步,换一个新的方向,重复上述步骤,直到找到出口为止。
源程序我有,但是是一个有向图的最短路径的搜索算法,基本上差不多,你感兴趣的话,我可以给你。
我的OICQ号码为:33360291