Algorithms, Programming, Interview, Python.
math from heapq import heappop, heappush class Node: def __init__(self, vertex, weight=0): self.vertex = vertex self.weight = weight def __lt__(self, other): return self.weight < other.weight class Graph: def __init__(self, edges, n): self.adjList = [[] for _ in range(n)] for (source, dest, weight)