CS 3.5. (ALEVEL) - Sorting Algorithms Flashcards

(2 cards)

1
Q

Bubble sort

A
  • Time complexity is O(n²)
  • make passes through data and swaps adjacent items to order them , stops passing through data when no swaps performed
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Merge sort

A

-Time complexity is O(nlogn).
- Divide and Conquer method, split array into individual lists then merge them together sorted

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