Untitled

mail@pastecode.io avatar
unknown
java
2 years ago
1.0 kB
1
Indexable
Never
        public static int getMeOuttaHere(int n, int m, int s, int t, Set<Edge> edges) {

            ArrayList<HashMap<Integer, Integer>> arrayList = new ArrayList<>();

            for(Edge edge : edges) {

                int edgeFrom = edge.from;
                int vertex = edge.to;
                int edgeWeight = edge.weight;
                arrayList.add(edgeFrom, new HashMap<>(vertex, edgeWeight));
            }

            ArrayList<Integer> mst = new ArrayList<>();
            PriorityQueue<Integer> queue = new PriorityQueue<>();

            int[] vertex = new int[n];
            int[] key = new int[n];


            vertex[0] = 0;
            key[0] = 0;
            for(int i = 1; i <= n; i++) {

                vertex[i] = i;
                key[i] = Integer.MAX_VALUE;
            }

            while(!queue.isEmpty() && (mst.size() < n)) {

                int node = queue.remove();

                
                }

            }

    return -1; 

}