Quicksort Flashcards

1
Q

Stable Sorting

A

If the same element is present multiple times, then they retain the original relative order of positions.

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

In place sorting

A

Sorting of a data structure does not require any external data structure for storing the intermediate steps.

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

Quicksort is ___, but not ___.

A

In place, but not stable.

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

Mergesort is ___, but not in place.

A

Stable, but not in place.

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

Quicksort Worst Case

A

θ(n^2)

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

Quicksort Best Case Partitioning

A

T(n) = θ(n log n)

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

Quicksort Average Case

A

θ(n log n)

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

Pivot Selection Strategies

A

First or Last Element
Random
Median of 3 (left, right, and center)
Median of Medians.

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

Do not use quicksort recursively for:

A

arrays of size smaller than some threshold.

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