zoukankan      html  css  js  c++  java
  • 第二周星期六

    1.dijkstra算法的一种代码实现,一个dijkstra类

    public class Dijkstra {
    public static void main(String[] args) {
    int[][] graph=new int[][]{{0,Integer.MAX_VALUE,10,Integer.MAX_VALUE,30,100},
    {Integer.MAX_VALUE,0,5,Integer.MAX_VALUE,Integer.MAX_VALUE,Integer.MAX_VALUE},
    {Integer.MAX_VALUE,Integer.MAX_VALUE,0,50,Integer.MAX_VALUE,Integer.MAX_VALUE},
    {Integer.MAX_VALUE,Integer.MAX_VALUE,Integer.MAX_VALUE,0,Integer.MAX_VALUE,10},
    {Integer.MAX_VALUE,Integer.MAX_VALUE,Integer.MAX_VALUE,20,0,60},
    {Integer.MAX_VALUE,Integer.MAX_VALUE,Integer.MAX_VALUE,Integer.MAX_VALUE,Integer.MAX_VALUE,0}};
    int[] dis=new int[6];
    boolean[] visited=new boolean[6];
    visited[0]=true;
    for(int i=0;i<6;i++)
    dis[i]=graph[0][i];
    dijkstra(graph, dis, visited);
    for(int i=0;i<dis.length;i++)
    System.out.print(dis[i]+" ");

    2.计划明天继续看代码,先看懂再实际自己操作

    3.问题eclipse关机以后重新打开一些初始参数还不会调,正在尝试看视频教程和自己尝试

  • 相关阅读:
    hdu5714 拍照[2016百度之星复赛C题]
    hdu5715 XOR 游戏 [2016百度之星复赛D题]
    AFO
    BZOJ 3566 概率充电器
    BZOJ 3427 Bytecomputer
    BZOJ 4513 储能表
    BZOJ 3667 Miller_Rabin
    BZOJ 4557 侦察守卫
    BZOJ 3894 文理分科
    SUOI #69 奔跑的Aqua
  • 原文地址:https://www.cnblogs.com/pekey/p/11440290.html
Copyright © 2011-2022 走看看