1/92
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced | Call with Kai |
|---|
No analytics yet
Send a link to your students to track their progress
Big O
Describes how an algorithm's time or space grows as input size grows
O(1)
Constant time. Runtime does not grow with input size
O(n)
Linear time. Runtime grows directly with input size
O(n²)
Quadratic time. Usually caused by nested loops over the same input
O(log n)
Logarithmic time. Usually caused by repeatedly cutting the input in half
O(n log n)
Usually appears in efficient sorting algorithms like merge sort, heap sort, and C++ sort
Drop constants in Big O
O(2n) becomes O(n), and O(10n) becomes O(n)
Drop smaller terms
O(n² + n) becomes O(n²)
Hash map lookup
Average O(1), but uses extra space
Brute force Two Sum
Checks every pair, so time complexity is O(n²)
Optimized Two Sum
Uses a hash map, so average time complexity is O(n)
Bitmasking
A technique where one integer stores multiple yes/no values using its binary bits.
Bitmask
The integer that holds the combined flags.
Bit flag
One bit inside the bitmask that represents one option, permission, or state.
Bitwise operators for bitmasking
Use | to add a flag, & to check a flag, and & ~ to remove a flag.