Which one of the following is an example for exponential time complexity?( )
A: O(2n)
B: O(n2)
C: O(n)
D: O(1)
A: O(2n)
B: O(n2)
C: O(n)
D: O(1)
A
举一反三
- Which one of the following is an example for exponential time complexity? A: O(2<sup>n</sup>) B: O(1) C: O(n) D: O(n<sup>2</sup>)
- T(n)=2*T(n/2)+ O(n),该递归方程描述的算法时间复杂度是 A: O(n2) B: O(nlog2n) C: O(2n) D: O(n)
- An algorithm has running time $T(n)$, which satisfies $T(n) = 4T(n/4) + O(n)$.So, its running time is _____. A: $O(n\log n)$ B: $O(n)$ C: $O(n^2)$ D: $O(n^2\log n)$
- Time complexity of accessing data stored in vertex v: 访问顶点v中存储的数据的时间复杂度: A: O(1) B: O(n) C: O(nlgn) D: O(n^2)
- 冒泡排序的时间复杂度是() A: O(n 2 ) B: O(nlog 2n) C: O(n) D: O(log 2n)
内容
- 0
计算下列程序段时间复杂度:inti=1;while(i<=n)i*=2 A: O(log(n)); B: O(n) C: O(2n) D: O(sqrt(n))
- 1
【单选题】顺序查找的时间复杂度是()。 A. O(n^2) B. O(2n) C. O(n) D. O(n/2)
- 2
下列算法的时间复杂度为n=n*n;while(n<0)n++;n=n*2;() A: O(1) B: O(n) C: O(n^(1/2)) D: O(n^2)
- 3
求其时间复杂度( )inti=1,n=100;while(i<n){ i=i*2;} A: O(log2n) B: O(n) C: O(nlog2n) D: O(n2)
- 4
分析下列程序段的时间复杂度是______。i=1:while(i<=n)i=i*2; A: O(n) B: O(n2) C: O(log2n) D: O(2*n)