C#深度优先搜索算法
本文实例为大家分享了C#深度优先搜索算法的具体代码,供大家参考,具体内容如下
//论文要用到其改进算法,在此先demo测试一下
usingSystem;
usingSystem.Collections.Generic;
usingSystem.Linq;
usingSystem.Text;
usingSystem.Threading.Tasks;
namespaceDFS
{
classProgram
{
publicint[,]map=newint[100,100];
publicint[]road=newint[120];
publicintn,x,y;
publicintm=1;
publicint[]visited={0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,};
staticvoidMain(string[]args)
{
Programpro=newDFS.Program();
inti,j;
pro.n=int.Parse(Console.ReadLine());
pro.x=int.Parse(Console.ReadLine());
pro.y=int.Parse(Console.ReadLine());
for(i=0;i
以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持毛票票。
热门推荐
10 新人红包祝福语简短精辟
11 幼师给毕业祝福语简短
12 生日高考祝福语妹妹简短
13 下飞机祝福语简短英文
14 元宵发客户祝福语简短
15 爸妈金婚文案祝福语简短
16 新郎朋友红包祝福语简短
17 虎年五一祝福语大全简短
18 出阁宴祝福语姐姐简短