Skip to content

Instantly share code, notes, and snippets.

View SystemicEmotions's full-sized avatar

SystemicEmotions

  • Amazon Web Services
View GitHub Profile
from collections import defaultdict
class Graph:
def __init__(self):
self.neighbours=defaultdict(list)
def addEdge(self,u,v):
self.neighbours[u].append(v)
self.neighbours[v].append(u)