Exam 1 Cards Flashcards

1
Q

The convex hull lower bound references the_________ lower bound

A

sorting

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

If you walk around the vertices of a convex hull in a counter clockwise direction, at the vertices you make________turns

A

only left turns

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

The greedy strategy for giving back change using the minimum number of coins is to repeatedly give back the highest coin denomination that is less than or equal to the amount of change. Give back 42c, how many coins are given as change?

A

4

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

Which of these algorithms is not a good example of a divide and conquer approach?

A

sweep line algorithm to find if any line segments intersect

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

If we add 13c coin to the US coins list, waht is the smallest amount of change that can be given back where the greedy strategy fails with the 13c coin added?

A

15

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

The time to find a convex hull using the Graham Scan algorithm if the points are given in increasing order of polar angle with respect to the lowest point is________

A

O(n)

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

When solving the 0/1 knapsack problem, what do the indexes of each axis of the table represent?

A

The upper index in the list of items that can be considered and the capacity of the knapsack

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

“dog” is a subsequence of “dcoagt”

A

true

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

What is the solution to the recurrence T(n) = 4 T(n/4) + 2 T(n/2) + n?

A

O(n^2)

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

What is the solution to the recurrence T(n) = 2 T (N/4) + 2N^0.5 ?

A

O(N^0.5 lg N)

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

When the sweep line algorithm reaches a right point, what actions does it take? Assume the point is p and the line it is on is L. Select all that apply.

A

Remove the line from the tree and Checks to see if there exists a line above or below L, if there are, check if the intersect

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

Given a set of n points in counter-clockwise order, the running time to verify that the set of points form a convex polygon is______

A

O(n)

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

Cross product operations can be used to determine if two line segments intersect

A

True

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

The following recurrence fits the form for the master theorem: T(n) = 2T(n/4) + T(n/5) + O(n^2)

A

false

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

What is the solution to the following recurrence? T(n) = 4T(n/3) + n

A

O(n^log3 4)

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

The data structure needed to store the line segments int the sweep line algorithm to find intersecting line segments is a ________

A

Balanced Search Tree

13
Q

What is the runtime for Jarvis March?

A

O(n * h)

14
Q

Typical dynamic programming solutions involve table storage and a recursive mathematical formula?

A

True

15
Q

The knapsack problem we solved using dynamic programming allows the individual items to be divided into smaller pieces?

A

False

16
Q

Longest common subsequence of abbcba and cbabca

A

bbca or abca

17
Q

The O(n lg n) algorithm to find the closest pair of points as discussed in class uses:

A

all of the above (divide and conquer paradigm, sorting by both x and y coordinates)

18
Q

If 0-1 knapsack problem has n items and a knapsack capacity of C, the number of entries in the table computer by the dynamic programming algorithm is:

A

n * C