题目内容
(请给出正确答案)
[主观题]
程序段 for (i=n;i>0;i--) for (j=1;j<i;j++) if (a[j]> a[j+1]) Swap(A[j],A[j+1]); //将A[j]与A[j+1]对换 其中 n为正整数,则在最坏情况下算法的时间复杂度是:
A、O(n)
B、O(nlogn)
C、O()
D、O()
提问人:网友chen11831
发布时间:2022-01-07
A、O(n)
B、O(nlogn)
C、O()
D、O()
A、m=2
B、m=4
C、m=6
D、m=5
A、m=6
B、m=2
C、m=4
D、m=5
A.7,2,5,4,3,6,1,
B.1,6,3,4,5,2,7,
C.7,6,5,4,3,2,1,
D.1,7,3,5,6,2,1,
include
using namespace std;
template
void sort(T b[],int n)
{
T temp;
int i,j;
T *a=new T[n];
for (i=0;i
for(i=0;i
{
for(j=i+1;j
{ if(a[i]>a[j])
{temp=a[i];
a[i]=a[j];
a[j]=temp;
}
}
}
for(i=0;i
}
void main()
{
int i,n=6;
int a[]={5,1,9,10,3,8};
____________;
for(i=0;i
{cout$amp;cout$amp;}
B、16
C、20
D、24
B、128
C、216
D、256
A、int 用于区分后置++运算符
B、int是参加运算的函数参数
C、int是前置标志
D、int什么也不是
为了保护您的账号安全,请在“简答题”公众号进行验证,点击“官网服务”-“账号验证”后输入验证码“”完成验证,验证成功后方可继续查看答案!