Sorting Algorithms Flashcards

(6 cards)

1
Q

What is Bubble Sort?

A

compares two items at a time and swaps them if they are in the wrong order. It repeats this until the whole list is sorted It goes through the list many times, each time moving the biggest unsorted item to the end

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

What is Merge Sort?

A

It keeps splitting the list in half until each piece has one item, then puts the pieces back together in the right order.

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

What is Insertion Sort?

A

Insertion Sort builds a sorted list one item at a time by inserting each new item into the right place.

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

Which is the fastest

A

Merge Sort is usually the fastest because it splits the list and works on parts at the same time.

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

Which sorting algorithm is the simplest?

A

Bubble Sort is the simplest to understand, but it’s also the slowest for large lists.

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

When is Insertion Sort useful?

A

Insertion Sort is good for small lists or when the list is almost sorted already.

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