Untitled

mail@pastecode.io avatar
unknown
plain_text
5 months ago
238 B
1
Indexable
def bfs(graph, start)
    visited = set()
    queue = dequeue(start)

    while queue:
        node = queue.popleft()
        if node is not in visited:
            visited.add(node)
            queue.extend(graph[node])
            
    
Leave a Comment