Big O Notation - Time Complexity

0.0(0)
Studied by 0 people
call kaiCall Kai
Locked
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/63

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 9:01 AM on 7/20/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai
Chat

No analytics yet

Send a link to your students to track their progress

64 Terms

1
New cards
<p>What is the Big O of this?</p>

What is the Big O of this?

O(n)

2
New cards
<p>What is the Big O of this?</p>

What is the Big O of this?

O(n²)

3
New cards
<p>What is the Big O of this?</p>

What is the Big O of this?

O(log n)

4
New cards

Which is asymptotically faster: O(n) or O(log n)?

O(log n)

5
New cards

What is the best possible Big O complexity?

O(1)

6
New cards

What is generally the fastest practical complexity for searching sorted data?

O(log n)

7
New cards

Which grows faster: O(n) or O(n log n)?

O(n log n)

8
New cards

Which grows faster: O(n²) or O(2ⁿ)?

O(2ⁿ)

9
New cards

Which grows the fastest?

  • O(n²)

  • O(2ⁿ)

  • O(n!)

  • O(n)

O(n!)

10
New cards

What happens to O(1) as n increases?

It stays constant

11
New cards

Why do programmers care about Big O?

It predicts how algorithms scale with larger inputs

12
New cards

Does Big O ignore constants?

Yes: O(2n) → O(n)

13
New cards

Does Big O ignore lower-order terms?

Yes: O(n² + n) → O(n²)

14
New cards
<p>Which dominates? </p>

Which dominates?

15
New cards
<p>Which dominates?</p>

Which dominates?

n log n

16
New cards

Is O(n + m) always simplified?

No. It stays O(n + m) if n and m are independent.

17
New cards

Is O(n + n) simplified?

Yes → O(n)

18
New cards

Which is usually preferred?

  • O(n²)

  • O(n log n)

O(n log n)

19
New cards
<p>What is the Big O?</p>

What is the Big O?

O(nm)

20
New cards
<p>What is the Big O? </p>

What is the Big O?

O(n log x)

21
New cards
<p>What is the Big O? </p><p></p>

What is the Big O?

O(n)

22
New cards

What is the Big O of finding an element in an unsorted array?

O(n)

23
New cards

What is the Big O of binary search?

O(log n)

24
New cards

What kind of algorithm usually has O(n log n)?

Efficient comparison-based sorting algorithms

25
New cards

Array access

O(1)

26
New cards

Search in an unsorted array

O(n)

27
New cards

Insert at the end of a dynamic array (average)

O(1)

28
New cards

Insert at the beginning of an array

O(n)

29
New cards

Delete from the beginning of an array

O(n)

30
New cards

Why is inserting at the beginning O(n)

Every element must shift 1 position

31
New cards

Access the 50th node of a linked list

O(n)

32
New cards

Insert at the head of linked list

O(1)

33
New cards

Delete the head in linked list

O(1)

34
New cards

Search a linked list?

O(n)

35
New cards

Average lookup in hashmap

O(1)

36
New cards

Average insertion/deletion in hashmap

O(1)

37
New cards

Worst-case lookup in a hash table

O(n)

38
New cards

Search/insert/delete in a balanced BST

O(log n)

39
New cards

Search in an unbalanced BST

O(n)

40
New cards

Push/pop/peek stack

O(1)

41
New cards

Enqueue/dequeue/peek front in queue

O(1)

42
New cards

Which data structure provides average O(1) lookup

hashmap

43
New cards

Which data structure allows O(1) push and pop

stack

44
New cards

Which search algorithm requires sorted data?

bst

45
New cards

Which is faster for searching large sorted data?

  • Linear Search

  • Binary Search

binary search

46
New cards

Which complexity is considered efficient for sorting?

O(n log n)

47
New cards

Which complexity should generally be avoided for large inputs?

O(2ⁿ) and O(n!)

48
New cards

Why is dividing n by 2 O(log n)?

Because the number of times you can halve n until reaching 1 is log₂(n)

49
New cards

What pattern usually means O(log n)?

Repeatedly cutting the problem in half

50
New cards
51
New cards
52
New cards
53
New cards
54
New cards
55
New cards
56
New cards
57
New cards
58
New cards
59
New cards
60
New cards
61
New cards
62
New cards
63
New cards
64
New cards