please?

CodePudding user response:
N * log2nCodePudding user response:
O (n)Outer loop meaningless, memory cycle, not necessarily meet the outer loop condition, so the time complexity of time complexity is the inner loop, the inner loop is 1 to n cycle, there is n times, so is O (n)
CodePudding user response:
Of course, a prerequisite is the outcome of the I * 2 shall not exceed the scope of int, otherwise possible infinite loop,