以下代碼的時間復雜度是多少,如何將其更改為線性或對數時間復雜度? [英]What is the time complexity of the following code and how can I change it into linear or logarithmic time complexity?