Suitability of Algorithms (OCR A-Level Computer Science): Flashcards

📚Flashcards
Suitability 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

Two metrics for measuring algorithm efficiency

Execution time (speed) and space (memory usage)

Time complexity definition

Measures time taken as function of input size

Space complexity definition

Measures memory used during execution

O(1)O(1) time complexity name

Constant time

O(logn)O(\log n) time complexity name

Logarithmic time

O(n)O(n) time complexity name

Linear time

O(n2)O(n^2) time complexity name

Quadratic time

O(2n)O(2^n) time complexity name

Exponential time

What space complexity includes

Input data, temporary variables, call stack

Algorithm characteristic needed for large inputs

Lower time complexity

Bubble Sort time & space complexity

O(n2)O(n^2) time, O(1)O(1) space

Merge Sort time & space complexity

O(nlogn)O(n \log n) time, O(n)O(n) space

Binary Search time complexity

O(logn)O(\log n)

Linear Search suitability for data type

Works on unsorted data

More memory-efficient factorial approach

Iterative: O(1)O(1) space vs recursive O(n)O(n) space

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.