Are these algorithms stable and/or in place Flashcards

1
Q

What is stability?

A

A sorting algorithm is stable if any pair of equal numbers in the input array appear in the same order in the sorted array.

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

What is in place?

A

A sorting algorithm is in place if at any moment at most O(1) array elements are stored outside the array.

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

Insertion Sort.

A

Stable: Yes
In place: Yes

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

Merge Sort.

A

Stable: Yes
In place: No

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

Heap Sort.

A

Stable: No
In place: Yes

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

Quicksort

A

Stable: No
In place: Yes

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

Countingsort

A

Stable: Yes
In place: No

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

Radixsort.

A

Stable: Yes
In place: No

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