O(log n)
Very very efficient. Most of the time it is base 2 O(8) → 3 as an example. less lines for every value.
Example
Example Program
dependant on which power of 2. for example, if our argument is 69, the program would follow a process like this:
result | power | |
---|---|---|
69 | 1 | |
34 | 2 | |
17 | 3 | |
8 | 4 | |
4 | 5 | |
2 | 6 | |
1 | 7 |