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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Floyd-Warshall’s

runtime and facs

A

Floyd-Warshall iterates through all the nodes

O(n^3)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Pagerank formula

A

(1-d)/n
+
d(links incoming/links outgoing)

only add if links are incoming to the node

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Runtime of DFS

A

O(V+E)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly