First, the processing of the whole number of Parties
There are a few details to deal with when this is handled.
1. When the index is negative
2. When the exponential type is 0
3. Throw an exception when the condition is not met
One is often used to make a tree into a binary form, or to find the power of an integer or the power of a matrix.
This function is written by hand, so pay attention to jump out of the condition, the second use of recursion to achieve, third, with & Operation instead of the original operation, and before using the scope of the problem, will generally say that the parameter is n, but this n is how big it? Use the corresponding type to solve the operation of the corresponding scale
----------------------------------------------------------------------------the processing of the maximum number of bits from 1 to n---------------------------------- -------------------------------------------------------
When n is large, it cannot be processed with integers beyond the representation range of integers, when it is resolved from the angle of the string, while printing, looking for the boundary
One of the simplest ways is to compare each increment to the ' 999....99 ' to determine if it is equal, but the complexity is higher, and each comparison is a 0 (n) algorithm
The other is to determine whether the highest bit is rounded up after 1, if there is a rounding. So this number is the largest integer required.
The self-increment function
Another way to solve the problem is to use the idea of the whole arrangement in order to list the last item, so it is to use the idea of recursion to resolve the issue
The idea of using two functions is similar to the idea of a quick sort
The handling of integers in the point of a sword