Variables defined inside a method are called _____.
A. local variables
B. parameters
C. arguments
D. global variables
查看答案
You can redeclare the variable if it is declared in the method signature.
A. false
B. true
What is k after the following block executes? {int k = 2;nPrint("A message", k); } System.out.println(k);
A. 2
B. k is not defined outside the block. So, the program has a compile error
C. 1
D. 0
以下算法中加下划线的语句执行次数为()。int m=0,i,j;for(i=1;i<=n;i++)for(j=1;j<=2*i;j++)m++;
A. n
B. n+1
C. n(n+1)
D. n*n
某算法的时间复杂度为O(logn),表明该算法的()。
A. 问题规模是O(logn)。
B. 执行时间等于O(logn)。
C. 执行时间与O(logn)成正比
D. 问题规模与O(logn)成正比。