The second week Thursday

1, try some of the code that implements dijkstra, found some blog and video

mport java.util.*;

public class Dijkstra {
private Queue visited;
int[] distance;
尝试写一个函数
public Dijkstra(int len) {
// TODO Auto-generated constructor stub
visited=new LinkedList();
distance=new int[len];

}

private int getIndex(Queue q,int[] dis)
{
int k=-1;
int min_num=Integer.MAX_VALUE;
for(int i=0;i<dis.length;i++)
{
if(!q.contains(i))
{
if(dis[i]<min_num)
{
min_num=dis[i];
k=i;
}
}
}
return k;

2. plans to continue to look for relevant information to learn tomorrow, tackling Code

3. The question yet to find a more complete and detailed tutorial, input and output specification is not yet clear, we do not know the code can not run, do not know the right plan to write after the completion of the test

----------------
Disclaimer: This article is CSDN blogger "carson0408 'original article, follow the CC 4.0 BY-SA copyright agreement, reproduced, please attach the original source link and this statement. .
Original link: https: //blog.csdn.net/carson0408/article/details/78634650

Guess you like

Origin www.cnblogs.com/pekey/p/11431869.html