##### ###### ##### ### # # ### # # ###### ## ## ## ## ## ## ## # # # # # ## ##### #### ##### # # # # # # # #### ## # ## ## ## ## # # # # # ## ## # ###### ## ### # ### # ######
##### ###### ##### ### # # ### # # ###### ## ## ## ## ## ## ## # # # # # ## ##### #### ##### # # # # # # # #### ## # ## ## ## ## # # # # # ## ## # ###### ## ### # ### # ######
What logarithms are, key properties, common vs natural log, and why O(log n) appears everywhere in CS. The inverse of exponentiation.
The Goal
Undoing exponentiation
Base and argument explained
Test your understanding
Most common in CS
Scientific notation base
Calculus and growth rates
Any base equals zero
Always equals one
First logarithm property
Second logarithm property
Third logarithm property
Test your understanding
Switch between any bases
All logarithms are equivalent
Divide and conquer
Halving the search space
Balanced binary trees
Test your understanding
LeetCode 50
Halve the exponent
Recursive solution
Time and space breakdown
What you learned
LeetCode 35
Find or insert position
Binary search solution
Step-by-step example
What you learned
LeetCode 279
Building from smaller values
DP solution
Why logs appear
What you learned
Tree height analysis
Balanced partitions
Heap operations
Test your understanding
LeetCode 378
Count elements below threshold
Binary search solution
What you learned
Binary representation
Counting digits
Test your understanding
Why log n is fast
Call stack usage
What to watch out for
What we learned