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
2
Q
Merge sort:
A
- Divides the list continuously by two until each list has 1 item
- Then combines two lists at a time, keeping the items in order
3
Q
Advantage and disadvantage of merge sort?
A
-Merge sort is more time efficient than bubble sort
-BUT merge sort uses more memory