Complexity of an algorithm
问题 I'm studying for a test and saw this question , so I did the following, is it correct? the while loop runs at O(log3n). the for loop runs at about O((n-(some math))*log2n) so because I have the minus symbol which is linear, I say that the whole method runs at O(nlogn), unless I'm wrong and it's something like O((n-(n/log3n))*log2n) <- not exactly but quite, can't really figure it out. is the minus linear here or not? if not what is the correct bigO? public void foo (int n, int m) { int i = m;