OCR CS Big O notation

0.0(0)
studied byStudied by 0 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/30

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

31 Terms

1
New cards

Best time complexity Linear search

O(1)

2
New cards

Average time complexity linear search

O(n)

3
New cards

Worst time complexity linear search

O(n)

4
New cards

Best time complexity binary search array

O(1)

5
New cards

Average time complexity binary search array

O(log n)

6
New cards

Worst time complexity Binary search array

O(log n)

7
New cards

Best time complexity binary search tree

O(1)

8
New cards

Average time complexity Binary search tree

O(log n)

9
New cards

Worst time complexity Binary search tree

O(n)

10
New cards

Best time complexity hashing

O(1)A

11
New cards

Average time complexity Hashing

O(1)

12
New cards

Worst time complexity hashing

O(n)

13
New cards

Best time complexity Breadth/depth first of a graph

O(1)

14
New cards

Average time complexity Breadth/depth first of a graph

O(V+E) No. Vertices + No. edges

15
New cards

Worst time complexity Breadth/depth first of a graph

O(V2)

16
New cards

Bubble sort best time complexity

O(n)

17
New cards

Bubble sort average time complexity

O(n²)

18
New cards

Bubble sort worst time complexity

O(n²)

19
New cards

Bubble sort space complexity

O(1)

20
New cards

Insertion sort best time complexity

O(n)

21
New cards

Insertion sort average time complexity

O(n²)

22
New cards

Insertion sort worst time complexity

O(n2)

23
New cards

Insertion sort space complexity

O(1)

24
New cards

Merge sort best time complexity

O(n log n)

25
New cards

Merge sort average time complexity

O(n log n)

26
New cards

Merge sort worst time complexity

O(n log n)

27
New cards

Merge sort space complexity

O(n)

28
New cards

Quick sort best time complexity

O(n log n)

29
New cards

Quick sort average time complexity

O(n log n)

30
New cards

Quick sort worst time complexity

O(n2)

31
New cards

Quick sort space complexity

O(log n)