big o notation

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

1/50

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

51 Terms

1
New cards

what is big o notation?

measures how no. of steps & memory usage change as the amount of data being processed increases

2
New cards

best case for linear search

o(1)

3
New cards

average case for linear search

o(n)

4
New cards

worst case for linear search

o(n)

5
New cards

best case for binary search array

o(1)

6
New cards

average case for binary search array

o(log n)

7
New cards

worst case for binary search array

o(log n)

8
New cards

best case for binary search tree

o(1)

9
New cards

average case for binary search tree

o(log n)

10
New cards

worst case for binary search tree

o(n)

11
New cards

best case for hashing

o(1)

12
New cards

average case for hashing

o(1)

13
New cards

worst case for hashing

o(n)

14
New cards

best case for breadth/depth first search

o(1)

15
New cards

average case for breadth/depth first search

o(V+E)

16
New cards

no. of vertices + edges

17
New cards

worst case for breadth/depth first search

o(V^2)

18
New cards

best case for bubble sort

o(n)

19
New cards

average case for bubble sort

o(n^2)

20
New cards

worst case for bubble sort

o(n^2)

21
New cards

space complexity of bubble sort

o(1)

22
New cards

best case for insertion sort

o(n)

23
New cards

average case for insertion sort

o(n^2)

24
New cards

worst case for insertion sort

o(n^2)

25
New cards

space complexity of insertion sort

o(1)

26
New cards

best case for merge sort

o(n log n)

27
New cards

average case for merge sort

o(n log n)

28
New cards

worst case for merge sort

o(n log n)

29
New cards

space complexity for merge sort

o(n)

30
New cards

best case for quick sort

o(n log n)

31
New cards

average case for quick sort

o(n log n)

32
New cards

worst case for quick sort

o(n^2)

33
New cards

space complexity for quick sort

o(log n)

34
New cards

o(1)

  • constant
35
New cards
  • always executes for the same amount of time regardless of the size of the data set
36
New cards
  • efficient with any data set
37
New cards

o(log n)

  • logarithmic
38
New cards
  • rate of increase gets smaller as the amount of data increases time
39
New cards
  • halves the data set in each pass
40
New cards
  • opposite to exponential
41
New cards
  • efficient with large data sets
42
New cards

o(n)

  • linear
43
New cards
  • grows in proportion to amount of data
44
New cards
  • reduces efficiency with increasingly large data sets
45
New cards

o(n log n)

  • linearithmic
46
New cards
  • divide a data set but can be solved using concurrency on independent divided lists
47
New cards

o(n^2)

  • performance proportional to the square of the size of the data set
48
New cards
  • significantly reduces efficiency with increasingly large data sets
49
New cards

o(2^n)

  • doubles with each addition to the data set in each pass
50
New cards
  • opposite to logarithmic
51
New cards
  • the rate of increase is at the rate k^n as n increases