_index.org

red-blak

Last edited: December 12, 2025

SU-CS161 TA Review

Last edited: December 12, 2025

TODO: create a table—algo, problem it solves, runtime, conditions. Prof lemmas?

Shortest-Path Algorithms

Dijikstra’s Algorithm

Intuition: subpaths of shortest paths are shortest paths. \(O\qty(n \log n + m)\)

Bellman-Ford Algorithm

Intuition: Dijkstra but k rounds across the whole graph

Floyd-Warshall Algorithm

All-pairs shortest path. Naive solution is \(O\qty(n)O\qty(nm) = O\qty(n^{2}m)\) by running bell

DP Problems

Greedy

SU-CS229 OCT272025

Last edited: December 12, 2025

neural network

Algorithms Index

Last edited: December 12, 2025

SU-CS161 Things to Review

SU-CS161 Embedded Ethics

Lectures

Divide and Conquer

Sorting

Data Structures

Graphs

DP

Greedy Algorithms

Closing

breadth first search

Last edited: December 12, 2025
L = [[start_node]]+[[] for _ in 1 ... n]
start_node.visited = True

for i = 0 ... n-1:
    for u in L[i]:
        for v in neighbor(u):
            if not v.visited:
                v.visited = True
                L[i+1].append(v)

This uses \(O\qty(n+m)\). We can find the shortest paths in \(O\qty(m)\)