datastructrue1 [최단경로] Bellman-Ford Algorithm 최단경로 알고리즘package com.study.datastructrue.mst;import java.util.ArrayList;import java.util.Arrays;class Pair { T node; V cost; public Pair(T node, V cost) { this.node = node; this.cost = cost; }}public class BellmanFord { static long[] dist = new long[6]; public static void main(String[] args) { // 집 1, 학교 2, 박물관 3, 영화관 4, 마트 5 ArrayList>> graph = inpu.. 2024. 7. 6. 이전 1 다음