单选题:The recurrent equations for the time complexities of programs P1
The recurrent equations for the time complexities of programs P1 and P2 are:
* P1: $$T(1)=1, T(N)=T(N/3)+1$$
* P2: $$T(1)=1, T(N)=3T(N/3)+1$$
Then the correct conclusion about their time complexities is: @[B](3)
A. they are both $$O(\log N)$$
B. $$O(\log N)$$ for P1, $$O(N)$$ for P2
C. they are both $$O(N)$$
D. $$O(\log N)$$ for P1, $$O(N\log N)$$ for P2
A.they are both $$O(\log N)$$
B.$$O(\log N)$$ for P1, $$O(N)$$ for P2
C.they are both $$O(N)$$
D.$$O(\log N)$$ for P1, $$O(N\log N)$$ for P2
答案:B
* P1: $$T(1)=1, T(N)=T(N/3)+1$$
* P2: $$T(1)=1, T(N)=3T(N/3)+1$$
Then the correct conclusion about their time complexities is: @[B](3)
A. they are both $$O(\log N)$$
B. $$O(\log N)$$ for P1, $$O(N)$$ for P2
C. they are both $$O(N)$$
D. $$O(\log N)$$ for P1, $$O(N\log N)$$ for P2
A.they are both $$O(\log N)$$
B.$$O(\log N)$$ for P1, $$O(N)$$ for P2
C.they are both $$O(N)$$
D.$$O(\log N)$$ for P1, $$O(N\log N)$$ for P2
答案:B