Comparison of the Complexity of Algorithms (OCR A-Level Computer Science): Flashcards

📚Flashcards
Comparison of the Complexity of Algorithms
Sign up to keep revising.Create a free account to study more flashcards and track your progress.

Practise the cards

15 cards from this deck

Show

Best case complexity

Minimum number of operations

Average case complexity

Expected performance across all possible inputs

Worst case complexity

Maximum number of operations

Linear Search worst case

O(n)O(n)

Binary Search average case

O(log⁡n)O(\log n)

Binary Search data requirement

Requires sorted data

Bubble Sort best case

O(n)O(n)

Merge Sort worst case

O(nlog⁡n)O(n \log n)

Quick Sort worst case

O(n2)O(n^2)

Quick Sort worst case occurs when

Pivot is smallest or largest element repeatedly

Selection Sort all cases complexity

O(n2)O(n^2)

Insertion Sort best case

O(n)O(n)

Why Bubble Sort best case is O(n)O(n)

Data already sorted, only one pass needed

What affects algorithm performance

Input characteristics: sorted, unsorted, reversed, random data

Merge Sort space complexity issue

Requires significant extra memory

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.