for 循环的最坏情况运行时,在 for 循环内有一个方法,即运行时是 Big O(log n)

Worst case runtime of a for loop with a method inside the for loop thats runtime is Big O(log n)

说我有一段代码像

for(int i = 0; i < n; i++){
    randomFuntion(); // runtimes function is O(log n)
}

这是否具有 O(n) 的总体最坏情况运行时间,还是只是 O(n log n)?

n 肯定登录。因为O(logn)绑定函数总是执行n次。