FINAL - algorithms/proofs Flashcards

1
Q

Integer multiplication solution

A

(see notebook) Should be XY = a function of I1, I2, I3…

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

Integer multiplication running time

A

n^(lg 3)

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

Draw the logic for maximum subarray (non-DP)

A

(see notebook…arrows coming out from middle element on combine step)

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

Write the recurrence for the MCM problem

A

(see notebook…m[i, k] + …)

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

MCM Pseudocode

A

(see notebook: MCM(p) )

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

BFS pseudocode

A

(see notebook: BFS(G, s) )

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

DFS pseudocode

A

(see notebook: DFS(G) and DFS-VISIT(u) )

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

How do you implement topological sort?

A

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

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

Strongly-Connected Components pseudocode

A

(see notebook: SCC(G) )

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

Prim’s algorithm pseudocode

A

(see notebook: Prim(G, w, r) )

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

Dijkstra’s algorithm pseudocode

A

(see notebook: Dijkstra(G, s) )

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

Interval coverage proof

A

(see notebook)

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

CLIQUE NPC proof

A

(see notebook)

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

LCS recurrence

A

(see notebook: c[i, j] = ….)

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

LCS pseudocode

A

(see notebook: LCSLength(X, Y) )

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

PrintLCS pseudocode

A

(see notebook: PrintLCS(b, X, i, j) )

17
Q

ASP proof

A

(see notebook)

18
Q

INDEPENDENT SET NPC proof

A

(see notebook: TODO)

19
Q

Making Change pseudocode

A

(see notebook: MC(n) )

20
Q

Max subarray (DP) pseudocode

A

(see notebook: MaxSubarray(A) )

21
Q

Rod-cutting recurrence

A

(see notebook: mv[n] = …)

22
Q

Knapsack recurrence

A

(see notebook: V[i, j] = …)