3 ms·
I don't know if that is helpful but logarithms are quite an easy concept that helps with thinking about code complexity. It's an inverse of exponent which tran
by kuboble 4y ago
I don't know if that is helpful but logarithms are quite an easy concept that helps with thinking about code complexity.
It's an inverse of exponent which translates to " grows very slowly with input size. 10 for a thousand, 20 for a million etc.". It helps to quickly ballpark feasability the same way exponential complexity usually means "doesn't scale above 30"
Log(n) is a
- number of digits required to write a number
- depth of a balanced tree of size n
- running time of any algorithm working on input of size n which does fixed cost operation to cut input in half (e.g binary search). If your code has cost function f(n) = 1 + f(n/2) then it has logarithmic performance.