Bubble Sort (OCR A-Level Computer Science): Flashcards

📚Flashcards
Bubble Sort
Sign up to keep revising.Create a free account to study more flashcards and track your progress.

Practise the cards

12 cards from this deck

Show

Bubble Sort definition

Repeatedly compares adjacent elements & swaps if wrong order

Pass in Bubble Sort

One complete iteration through the list

Stable property (Bubble Sort)

Maintains relative order of equal elements

In-Place property (Bubble Sort)

Requires small, constant extra memory

Best case time complexity: Bubble Sort

O(n)O(n)

Worst case time complexity: Bubble Sort

O(n2)O(n²)

Average case time complexity: Bubble Sort

O(n2)O(n²)

Purpose of swapped flag

Optimise & avoid unnecessary passes when list sorted

When Bubble Sort achieves O(n)O(n)

When list is already sorted

When Bubble Sort achieves O(n2)O(n²) worst case

When list sorted in reverse order

Main operation in Bubble Sort

Repeatedly swapping adjacent elements until sorted

Bubble Sort practicality for large data

Not practical - inefficient

Explore OCR A-Level Computer Science Revision Notes by Topics

Explore OCR A-Level Computer Science Model Answers by Topics

Explore OCR A-Level Computer Science Quizzes by Topics

Explore OCR A-Level Computer Science Exam Questions by Topics

Join 100,000+ A-Level students studying Flashcards with us.

Select your subjects, and get access to A+ resources today.