Lecture 1 - Radix Sort Flashcards

1
Q

What do we have to do to do better than O(nlogn) in sorting algorithms?

A

Use an approach that is not comparison based.

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

What does Radix sort do?

A

Exploits the structure of the numbers.

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

What is a disadvantage of Radix compared to any comparison-based algorithm?

A

It is not as versatile

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

What is a fact about Radix ?

A

That is it only faster than comparison based algorithms when used on large datasets

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

What does Radix Sort do?

A

Sorts a sequence of digits from each number in order, keeping order from previous iteration.

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

What is m and b in Radix Sort?

A

m = length of largest number in sequence
b = a factor of m, typically 2

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

How does changing b effect the execution of Radix Sort?

A

Larger b makes algorithm faster as m/b is smaller (m/b is the number of iterations), this does however increase the amount of space the algorithm uses.

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

How many iterations does Radix Sort use?

A

m/b

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

How many buckets does Radix sort need?

A

2^b buckets

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

What is the overall complexity of Radix Sort?

A

O(m/b * (n*2^b))
which is O(n), since m and b are constants

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

How does Radix Sort work?

A

There are m/b iterations. In each items are distributed into 2^b buckets, where a bucket is just a list. After buckets are concatenated and cleared ready for the next iteration.

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