以下代码的时间复杂度是多少,如何将其更改为线性或对数时间复杂度? [英]What is the time complexity of the following code and how can I change it into linear or logarithmic time complexity?