填空题

在长度为n的线性表中查找一个表中不存在的元素,需要的比较次数为 【1】 。

【参考答案】

n
<上一题 目录 下一题>
热门 试题

单项选择题
若有以下程序:# include <iostream>using namespace std;class Base{public: Base ( ) { x=0; } int x;};class Derived1 : virtual public Base{public: Derived1 ( ) { x=10; }}; class Derived2 : virtual public Base{public: Derived2 () { x=20; }};class Derived : public Derived1,protected Derived2{ };int main(){ Derived obj; cout<<obj.x<<end1; return 0;} 该程序运行后的输出结果是
A.10
B.20
C.30
D.0
单项选择题
有以下程序:#include <iostream>#include <math>using namespace std;class point{private: double x; double y;public: point(double a, double b { x=a; y=b; friend double distance (point a, point b ; };double distance(point a, point b return sqrt((a. x-b. x )*(a. x -b. x )+ (a. x -b. x)*(a. x-b. x));}int main (){ point p1(1,2); point p2(5,2); cout<<distance (p1, p2)<<end1; return 0;} 程序运行后的输出结果是
A.1
B.5
C.4
D.6
相关试题
  • C++中,设置虚基类的目的是 【11】 。
  • 下列程序的输出结果是 【14】 。#incl...
  • 下面程序的输出结果是 【15】 。#incl...
  • 下面程序的输出结果为:Base:: fun,请...
  • 数据模型分为格式化模型与非格式化模型,层...