4 ms·
In computer science, I read log as levels. n log n is n time levels(n, 2). levels is the number of time n can be repeatedly halved until result is less than 2.
by mizzlr_ 3y ago
In computer science, I read log as levels. n log n is n time levels(n, 2). levels is the number of time n can be repeatedly halved until result is less than 2. levels has something to do with recursion of problem into 2 smaller sub problems.
levels(n, 10) is approximately num_digits(n).
knowing that levels(10, 2) is approximately 3.32, I know that to represent 1000 (3 digits) needs 3 *3.32 approximately 10 bits. 1 million (6 digits) needs 20 bits. 1 billion needs 30 digits. bits are just binary digits.