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

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

Luz5年前 (2021-06-19)题库1031
The recurrent equations for the time complexities of programs P1 and P2 are:

- P1: $$T(1)=1$$, $$T(N)=T(N/2)+1$$;
- P2: $$T(1)=1$$, $$T(N)=2T(N/2)+1$$;

Then the best conclusion about their time complexities is:



A.they are both $$O(logN)$$
B.$$O(logN)$$ for P1, and $$O(N)$$ for P2
C.they are both $$O(N)$$
D.$$O(logN)$$ for P1, and $$O(NlogN)$$ for P2


答案:B