填空题

算法的复杂度主要包括______复杂度和空间复杂度。

【参考答案】

时间
<上一题 目录 下一题>
热门 试题

单项选择题
若有以下程序: #include <iostream> using namespace std; class A private: int a; public: A(int i) a=i; void disp () cout<<a<< , ; ; class B private: int b; public: B(int j) b=j; void disp () cout<<b<< , ; ; class C : public B,public A private: int c; public: C(int k):A(k-2),B(k+2) c=k; void disp () A::disp(); B::disp(); cout<<c<<endl; ; int main() C obj(10); obj.disp(); return 0;
A.10,10,10
B.10,12,14
C.8,10,12
D.8,12,10
单项选择题
有以下程序: #include <iostream> using namespace std; class sample private: int n; public: sample() sample(int m) n=m; void addvalue(int m) sample s; s.n=n+m; *this=s; void disp () cout<< n= <<n<<endl; ; int main() sample s(10); s.addvalue(5); s.disp(); return 0; 程序运行后的输出结果是
A.n=10
B.n=5
C.n=15
D.n=20
相关试题
  • 有以下程序: #include <iostream> u...
  • 已知int DBL(int n)return n+n;和lo...
  • 有以下程序 #include <iostream> usi...
  • 执行语句序列 int x=10,&r=x; co...
  • 下列程序的输出结果为 Object id=0 Ob...