Sorting Algorithms – Bubble and Merge (AQA A-Level Computer Science): Flashcards
📚Flashcards
Practise the cards
10 cards from this deck
ShowHide
Practise the cards
10 cards from this deck
Sorting (definition)
Sorting (definition)
Arranging data in a specific sequence/order
Bubble sort mechanism
Bubble sort mechanism
Compares adjacent elements, swaps if in wrong order
Origin of 'bubble sort' name
Origin of 'bubble sort' name
Larger values 'bubble up' to one end
Result after 1 bubble sort pass
Result after 1 bubble sort pass
Largest value moves to correct position at end
CompletedFlag purpose (bubble sort)
CompletedFlag purpose (bubble sort)
Tracks if swaps occurred; allows early termination
Merge sort strategy
Merge sort strategy
Divide & conquer: split to singles, merge back sorted
Recursion (definition)
Recursion (definition)
When a subroutine calls itself
Why merge sort is efficient
Why merge sort is efficient
Repeatedly halves lists, reducing comparisons needed
Memory: bubble vs merge sort
Memory: bubble vs merge sort
Bubble works in-place; merge needs extra memory
When to use bubble vs merge
When to use bubble vs merge
Bubble: small/limited memory; Merge: large data
