Bubble sort and merge sort Flashcards

1
Q

BUBBLE SORT:

A

• In one pass, go through each pair, swapping if needed
• Repeat passes until a pass happens with no swaps

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

Merge sort:

A
  1. Divides the list continuously by two until each list has 1 item
  2. Then combines two lists at a time, keeping the items in order
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Advantage and disadvantage of merge sort?

A

-Merge sort is more time efficient than bubble sort

-BUT merge sort uses more memory

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