Week 3 - Algorithms Flashcards

1
Q

How does Merge sort work?

A

It sorts smaller arrs and combine them together (merge them) on a sorted order

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

What’s Merge sort’s pseudocode?

A
  1. Sort the left half of the arr
  2. Sort the right half of the arr
  3. Merge the two halves together
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What’s Merge sort’s O?

A

n log n

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

What’s Merge sort’s Ω?

A

n log n

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

How does Insertion sort work?

A

It shifts elements out of the way if necessary to make room for smaller elements

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