FINAL - algorithms/proofs Flashcards
Integer multiplication solution
(see notebook) Should be XY = a function of I1, I2, I3…
Integer multiplication running time
n^(lg 3)
Draw the logic for maximum subarray (non-DP)
(see notebook…arrows coming out from middle element on combine step)
Write the recurrence for the MCM problem
(see notebook…m[i, k] + …)
MCM Pseudocode
(see notebook: MCM(p) )
BFS pseudocode
(see notebook: BFS(G, s) )
DFS pseudocode
(see notebook: DFS(G) and DFS-VISIT(u) )
How do you implement topological sort?
Run DFS on the graph. As each vertex is finished, insert it at the FRONT of a linked list. Return this list when done, which contains the topological sorted nodes
Strongly-Connected Components pseudocode
(see notebook: SCC(G) )
Prim’s algorithm pseudocode
(see notebook: Prim(G, w, r) )
Dijkstra’s algorithm pseudocode
(see notebook: Dijkstra(G, s) )
Interval coverage proof
(see notebook)
CLIQUE NPC proof
(see notebook)
LCS recurrence
(see notebook: c[i, j] = ….)
LCS pseudocode
(see notebook: LCSLength(X, Y) )