填空题

在最坏情况下,冒泡排序的时间复杂度为______。

【参考答案】

n(n-1)/2
<上一题 目录 下一题>
热门 试题

单项选择题
有如下程序: #include<iostream> using namespace std; class TestClass static int i; public: TestClass()i++; ~TestClass()i--; static int getVal()return i; ; int TestClass::i=0; void f()TestClass obj2;cout<<obj2.getVal(); int main() TestClass obj 1; f(); TestClass *obj3=new TestClass;cout<<obj3->getVal(); delete obj3;cout<<TestClass::getVal(); return 0; 程序的输出结果是( )。
A.232
B.221
C.222
D.231
单项选择题
下列程序执行后,屏幕的输出是( )。 #include<iostream> using namespace std; void swap(int x,int y) int temp=x; x=y; y=temp; cout<< x= <<x<< ,y= <<y<<end1; int main() int x=3,y=2; swap(x,y); cout<< x= <<x<< ,y= <<y<<end1; return 0;
A.x=3,y=2
x=3,y=2
B.x=2,y=3
x=3,y=2
C.x=2,y=3
x=2,y=3
D.x=3,y=2
x=2,y=3
相关试题
  • 执行下列语句序列: im x=1,&y=x;...
  • 以下函数模板min的功能是返回数组a中最小元...
  • 有如下程序: #include<iostream> usi...
  • 在下面程序的横线处填上适当的语句,使程序...
  • 设p是指向一个类动态对象的指针变量,则执...