for (int index = 1; index < n; index *= 2) {
int counter = 0;
while (counter < n) {
counter ;
}
}
Determine its best and worst case runtime in the Big-Theta notation as a function of n.
I think the worst case is n*log(n), but I am not sure about the best case.
CodePudding user response:
The time complexity is indeed O(