Chapter 04 — Speeding Up Your Code with Big O

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

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 3:03 PM on 8/28/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai
Chat

No analytics yet

Send a link to your students to track their progress

13 Terms

1
New cards
Bubble Sort
A sorting algorithm that compares adjacent values and swaps them if out of order
2
New cards
Adjacent comparison
Comparing two neighboring values
3
New cards
Swap
Switching two values’ positions
4
New cards
Pass-through
One scan through part of the array
5
New cards
Bubble Sort behavior
Larger values bubble toward the end of the array
6
New cards
Bubble Sort stopping condition
Stop after a full pass-through with no swaps
7
New cards
Bubble Sort Big O
O(N²)
8
New cards
Why Bubble Sort is O(N²)
It makes many comparisons and swaps across multiple pass-throughs
9
New cards
O(N²)
Quadratic time; steps grow roughly with N squared
10
New cards
Nested loops
Loops inside loops, commonly causing O(N²)
11
New cards
Duplicate checking with nested loops
O(N²), because each value may be compared with every other value
12
New cards
Time-space tradeoff
Using extra memory to make an algorithm faster
13
New cards
O(N²) to O(N) improvement
Replace pairwise comparisons with one loop plus extra storag