S6-P3 Flashcards

1
Q
A

2
A

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

166 related:

When the array is already sorted, the ____ sorting algorithm is the best speed wise, and is of Order ____. The original sorting order and the desired sorting order (inc/dec) must be the same/doesn’t matter .

A

Insertion, O(n), same

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

*

167

A

1
A
Note On Quick Sort (qs) Recursive Function: We use median as pivot for the best complexity order, when we find the median ( θ(n) ), we create the recursive tree, each side has n/2 numbers that the same process happens to them.

Reminder: Order of partition based on an element in an array is θ(n), because we’re finding the kth element in an array.

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

3
A
Key phrase:جمله تقریبا مرتب

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

168 related:

What’s the order of sorting K sorted list, each having n/k members?

A

O(All the elements (n) x log number of sorted lists (K))=O(n x logk)

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

F this but read it to gain perspective

169

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

End Of P3

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