Chapter 07 — Big O in Everyday Code

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/18

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 1:41 PM on 9/1/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai
Chat

No analytics yet

Send a link to your students to track their progress

19 Terms

1
New cards
One loop over N items
O(N)
2
New cards
Two separate loops over N items
O(N), because O(2N) simplifies to O(N)
3
New cards
Two nested loops over same N
O(N²)
4
New cards
Three nested loops over same N
O(N³)
5
New cards
Fixed number of operations
O(1)
6
New cards
Fixed inner loop
O(N), because N times a constant simplifies to O(N)
7
New cards
Shrinking inner loop
Still O(N²) if it grows with N
8
New cards
Multiple inputs rule
Use different variables such as N and M
9
New cards
Nested loops over two arrays
O(N * M)
10
New cards
Merge two sorted arrays
O(N + M)
11
New cards
Repeated halving
O(log N)
12
New cards
Password combinations
Exponential growth, such as O(26^N)
13
New cards

OA clue

Separate loops add; nested loops multiply; halving is logarithmic

14
New cards

N + N = 2N = O(N)

Separate loops:

15
New cards

N * N = O(N²)

Nested loops, same N:

16
New cards

N * 5 = O(N)

Nested loops, fixed inner loop length of 5:

17
New cards

N * M = O(N * M)

Nested loops, two different inputs:

18
New cards

O(log N)

Loop cuts problem in half:

19
New cards

N * N * N = O(N³)

Three nested loops over same N: