问题
单项选择题
下面程序段的时间复杂度为( ) s=0; for(i=1;i<n;i++) for(j=1;j<i;j++) s+=i*j;
A.O(1)
B.O(log2
C.O(
D.O(n3)
答案
参考答案:D
下面程序段的时间复杂度为( ) s=0; for(i=1;i<n;i++) for(j=1;j<i;j++) s+=i*j;
A.O(1)
B.O(log2
C.O(
D.O(n3)
参考答案:D
阅读理解。 | |||||||||||||||||||||||||
| |||||||||||||||||||||||||
1. Who has rice for dinner? | |||||||||||||||||||||||||
A. Sally and Mike B. Lucy and Mike C. Maria and Lucy D. Sally and Maria | |||||||||||||||||||||||||
2. Who swims after dinner? | |||||||||||||||||||||||||
A. Maria B. Mike C. Sally D. Lucy | |||||||||||||||||||||||||
3. What does Mike have for dinner? | |||||||||||||||||||||||||
A. Meat and rice. B. Chicken and dumplings C. Bread and vegetables. D. Hamburgers and juice. | |||||||||||||||||||||||||
4. What does Maria do after lunch? | |||||||||||||||||||||||||
A. Plays volleyball. B. Plays basketball. C. Plays football. D. Plays the guitar. | |||||||||||||||||||||||||
5. Which of the following is NOT true? | |||||||||||||||||||||||||
A. Lucy plays table tennis after dinner. B. Mike has meat and rice for dinner. C. Sally plays basketball after lunch. D. Maria has hamburgers and juice for lunch. |