Exam Flashcards

(92 cards)

1
Q
A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q
A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q
A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q
A
  • Run the jobs in decreasing order of finishing time f_i
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q
A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q
A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q
A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q
A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Exchange argument

A
  • Does not decrease optimality
  • e.g, in EEF, it still contains an disjoint set of intervals when exchanging the leftmost intervals from set O (optimal set) and A (algorithm set)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q
A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q
A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q
A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q
A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q
A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q
A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q
A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q
A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q
A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q
A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q
A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q
A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q
A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q
A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q
A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
26
* Show how to swap * In case of interval scheduling, swap the two leftmost solutions from optimal and algorithms * Show how the swap doesnt decrease optimality * In case of interval scheduling, since the interval has EEF, this does not intersect other intervals in the optimal set, hence its also an optimal solution
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
OPT(j)= max(v\_j + OPT(P(j)), OPT(j -1)) we define PU), for an interval j, to be the largest index i \< j such that intervals i and j are disjoint
64
# Definitions Give definition of Dynamic programming
* Solve problem by solving sub instance of problem For a given instance of a problem, we consider certain sub-instances that grow incrementally. For each of these sub-instances it suffices to keep one optimal solution (because, by an exchange argument, no other solution can lead to a better final solution for the entire instance). The optimal values are then computed step by step on the growing sub-instances. A “recursive” formula specifies how to compute the optimal value from the previously computed optimal values for smaller sub-instances. However, it is not applied recursively, rather, the values are stored in an array, and calculations happen in a for-loop.
65
What are the topics in the course
1. Time complexity, O Notation 2. Greedy 3. Dynamic programming 4. Searching, divide and conquer 5. Reduction, NP completness 6. DAG's and graph properties
66
Give *stay ahead* argument for Interval scheduling
Algorithm has the option to choose candidate j\_r as its solution
67
Types of greedy problem
* Picking out a subset (interval scheduling) * Then use exchange argument * Give an ordering * Use “swapping” argument where you swap the order of the elements
68
Unroll the following recurrence 2T(n/2) + O(n)
69
What are some characteristics of algorithms
* Looping * Looping through the whole input, O(n) complexity * No looping in algorithm refers to constant time i.e, O(1) * Elementary operations * Arithemtic operations * If conditions - adding/mdulitplication, querying etc… indexing * Indexing/querying database or array
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92