Analysis of random splitters Flashcards

1
Q

What is the goal of the median-finding problem?

A

To find the middle element of a sorted set of numbers.

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

What is the Select algorithm used for?

A

Select(S, k) finds the kth largest element in a set S of n numbers.

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

What is the base case for the Select algorithm?

A

If |S| = 1, then the single element in S is returned.

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

Why is a ‘splitter’ chosen in the Select algorithm?

A

A splitter divides the set S into subsets S- and S+, allowing the search for the kth largest element to focus on a smaller subset.

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

What is the expected time complexity of the Select algorithm?

A

The expected time complexity is O(n).

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

How does the choice of a splitter affect the Select algorithm’s performance?

A

A well-centered splitter significantly reduces the size of the subset considered in recursive calls, improving performance.

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

What happens if the splitter in Select is the minimum element?

A

The algorithm performs poorly, as the recursive call reduces the subset size by only one element.

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

Why is randomization used to choose the splitter in Select?

A

Randomization ensures a high probability of choosing a well-centered splitter, avoiding worst-case scenarios.

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

What is the probability of selecting a ‘central’ splitter in the Select algorithm?

A

The probability is 1/2, as half of the elements in the set are central.

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

What is the recurrence for Select when random splitters are used?

A

T(n) ≤ T((3/4)n) + cn, which resolves to O(n) using geometric series analysis.

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

What is the Quicksort algorithm?

A

Quicksort is a sorting algorithm that uses a random splitter to divide a set into two subsets, recursively sorting each.

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

What is the worst-case running time of Quicksort?

A

The worst-case running time is O(n^2), occurring when splitters are poorly chosen (e.g., smallest elements).

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

What is the expected running time of Quicksort?

A

The expected running time is O(n log n), achieved through randomization of splitters.

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

What is a central splitter in Quicksort?

A

A central splitter divides the set so that each subset contains at least a quarter of the elements.

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

What is the role of randomization in Quicksort?

A

Randomization increases the likelihood of selecting central splitters, ensuring efficient sorting.

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

What is Modified Quicksort?

A

Modified Quicksort finds a central splitter before making recursive calls, ensuring balanced division of subsets.

17
Q

What is the expected time spent in one phase of Modified Quicksort?

A

The expected time spent in one phase, excluding recursive calls, is O(|S|), where S is the set size.

18
Q

How many iterations are expected to find a central splitter in Modified Quicksort?

A

The expected number of iterations is 2, as half of the elements are central.

19
Q

What is the recurrence for Modified Quicksort’s time complexity?

A

T(n) ≤ 2T((3/4)n) + cn, leading to an expected running time of O(n log n).

20
Q

How does the number of subproblems relate to the phase type in Modified Quicksort?

A

There are at most (4/3)^j subproblems of type j, where j is the phase type.

21
Q

What is the difference between Quicksort and Modified Quicksort?

A

Quicksort accepts all splitters, while Modified Quicksort retries until finding a central splitter.

22
Q

What is the purpose of splitting the input set in Quicksort?

A

Splitting organizes elements smaller than the splitter into one subset and larger elements into another for efficient sorting.

23
Q

How does recursion in Quicksort handle subsets?

A

Quicksort recursively sorts subsets created by splitting, then combines them with the splitter to form the sorted output.

24
Q

What is the intuition behind the efficiency of Quicksort?

A

Randomly chosen splitters are likely to balance subsets, leading to efficient sorting on average.

25
Q

What is the convergence property of Quicksort’s recurrence?

A

The recurrence forms a geometric series, ensuring O(n log n) expected time for sorting.

26
Q

What is the geometric series’ role in analyzing Quicksort?

A

The geometric series bounds the total work across recursive calls, showing the algorithm’s efficiency.

27
Q

How does Modified Quicksort guarantee balanced recursive calls?

A

By ensuring splitters are central, Modified Quicksort reduces each subset by at least 25%.

28
Q

What is the relationship between randomization and performance in Quicksort?

A

Randomization reduces the likelihood of worst-case scenarios, maintaining expected O(n log n) performance.

29
Q

What happens when Modified Quicksort updates the splitter?

A

It retries splitting with a new random splitter until a central splitter is found.

30
Q

How is the running time of Modified Quicksort bounded?

A

The running time is bounded by summing the expected costs of processing subsets of decreasing size, yielding O(n log n).