-->
当前位置:首页 > 题库

单选题:The recurrent equations for the time complexities of programs P1

Luz5年前 (2021-05-10)题库1405
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