Quiz 2
Registry Synced

Graph Algorithms

94 words
1 min read

Reading compass

Now · BFS (Breadth-First Search)

Graph Algorithms

python
from collections import deque
def bfs(graph, start):
    visited = set()
    queue = deque([start])
    visited.add(start)
    while queue:
        v = queue.popleft()
        for neighbor in graph[v]:
            if neighbor not in visited:
                visited.add(neighbor)
                queue.append(neighbor)
    return visited
python
def dfs(graph, start, visited=None):
    if visited is None:
        visited = set()
    visited.add(start)
    for neighbor in graph[start]:
        if neighbor not in visited:
            dfs(graph, neighbor, visited)
    return visited

Dijkstra's Shortest Path

Complexity: O(VlogV+E)O(V \log V + E) with binary heap. Join Discord PreviousEulerian & HamiltonianNextNumber Theory & RSA
Document outline

Keep your place and jump directly to a heading.

Table of Contents
System Normal // Awaiting Context

Intelligence Hub

Navigate the knowledge graph to generate context. The Hub adapts dynamically to surface backlinks, related notes, and metadata insights.