unit 3 AOS 2 Flashcards
1
Q
Limitations of prims
A
Limitation: cannot work for disconnected node and prims (by default) assumes all edges are undirected unless modified
2
Q
Limitation and runtime of Dijksta’s
best + worse case
A
- Does not reconsider nodes that has already been visited
- does not consider negative loops
MAY not work with negative cycles
WORSE: O(V^2) [for single source shortest path]
Best: O(1)
3
Q
Bellman-Ford
runtime and facts
A
- Each iteration has to go through every edge
- Bellman-Ford iterates through all the edges (NOT NODES)
- runs |v|-1 times (unless uses naiive implmentation)
O(V E)
4
Q
Floyd-Warshall’s
runtime and facs
A
Floyd-Warshall iterates through all the nodes
O(n^3)
5
Q
Pagerank formula
A
(1-d)/n
+
d(links incoming/links outgoing)
only add if links are incoming to the node
6
Q
Runtime of DFS
A
O(V+E)