sorting Flashcards

1
Q

insertion sort facts

A

best O(n)
average and worst O(n^2)
stable
in place

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

selection sort facts

A

O(n^2) across the board
not stable
in place

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

heapsort facts

A

O(n log n) across the board
not stable
in place

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

merge sort facts

A

O(n log n) across the board
stable
not in place

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

quick sort facts

A

the one that uses a pivot point and recursion/subarrays
best and average O(n log n)
worst case O(n^2)
not stable
in place

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

stable sorting

A

If a sort guarantees the relative order of equal items stays the same,
then it is a stable sort

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

In Place Sorting

A

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

The amount of extra space required to sort the data is constant with
the input size.

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

bucket sort facts

A

O(n + k) across the board
n is the number of elements
k is the number of buckets

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

counting sort facts

A

O(n + k) across the board
n is the number of elements
k is range of elements

stable but not in place

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

radix sort facts

A

O(d * n) across the board
n is the number of items
d is the number of digit keys

not in place

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