单选题:In the best case,which is the time complexity for the following
In the best case,which is the time complexity for the following code?
high=N-1;
while(high>0){
j=0;
for(i=0;iA[i+1]){
swap(A[],i,i+1); //swap the i and i+1 element of array A[]
j=i;
}
high=j;
}
}
A.O(1)
B.O($$logN$$)
C.O($$N$$)
D.Θ($$N^2$$)
答案:C