Midterm Flashcards

Preparation for the mid-term (18 cards)

1
Q

When are Fibonacci trees used?

A

Constructing a priority queue with excellent amortized complexity for DECREASE-KEY

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

Dynamic optimality is a concept involving the comparison of

A

An online data structure to an offline data structure.

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

Suppose you already have 16 different coupons when there are 20 coupon types. What is the expected number of boxes
for obtaining a coupon different from the 16 you already have?

A

5

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

If the universe size at the root of a van Emde Boas tree is u, then the number of children is:

A

sqrt(u)

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

To support computing prefix sums of all keys that are no larger than some query key, an augmented binary search tree
stores the following at every node:

A

the sum of all keys in the left subtree

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

Which Fibonacci heap operation has Θ(log n) worst-case actual cost?

A

FIB-HEAP-DECREASE-KEY

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

What is the main contribution of leftist heaps?

A

The UNION is computed in Ο(logn) time

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

The number of potential probe sequences when using linear probing with a table with m entries (m is prime) is

A

m

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

Which of the following is not true regarding the amortized analysis of binary tree traversals.

A

SUCC had an amortized cost of 2.

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

data structure is not used to implement a dictionary?

A

Self organizing list

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

The reason for marking nodes in a Fibonacci heap is:

A

to indicate nodes that have lost a child since becoming a child themselves

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

If a Fibonacci tree appears as a subtree of an AVL tree, which nodes would be assigned a balance factor of 0?

A

None of them

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

The main difference between MTF and OPT for self-organizing linear lists is:

A

OPT is given the entire request sequence in advance, while MTF receives the requests one-at-a-time

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

To reduce the probability of having any collisions to < 0.5 when hashing n keys, the table should have at least this number
of elements.

A

n ln n

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

Harmonic numbers

A

Sum of the reciprocals

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

Load factor calculation

A

Number items / Array size

17
Q

What is the golden ration?

A

(1+sqrt(5)) / 2 == 1.6

18
Q

factorial formula for n choose k

A

n! / k! (n - k)!