文档下载 文档下载导航
设为首页 | 加入收藏
搜索 请输入内容:  
 导航当前位置: 文档下载 > 所有分类 > 高等教育 > 理学 > 数据结构题库
侵权投诉

数据结构题库

provide a uniform interface between the algorithms and containers. (b)

(a) pointers

(b) iterators

(c) arrays

(d) virtual functions

2.1.2

1. If A is an STL vector, then the effect of executing the statement

A[i] = x;

is to (b)

(a) check array bounds, enlarge the vector if necessary, and then write x to position i

(b) write x to position i of the vector, without bounds checking

(c) check array bounds, and write x to position i if and only if i is in the proper range

(d) create an iterator x pointing to position i in the array

2. Consider the following declaration that makes use of a user-defined class Thing.

vector<Thing> A(10);

In order that it compile, the class Thing must have which of the following? (c)

(a) a copy constructor

(b) an assignment operator

(c) a default constructor

(d) a destructor

3. The capacity of an STL vector is defined to be the (d)

(a) difference between the current number of elements and the maximum number of elements

(b) number of elements currently stored in the vector

(c) maximum number of elements the vector could possibly have on the given machine

(d) maximum number of elements that can be stored in the vector without resizing

4. The size of an STL vector is defined to be the (a)

(a) number of elements currently stored in the vector

(b) total of the sizes of the data members in the vector class

(c) maximum number of elements that can be stored in the vector without resizing

(d) number of bytes the vector occupies in memory

5. Consider the following program segment. (d)

vector<int> A(10);

A.resize(0);

A.push_back(5000);

At the end of an execution of this fragment, the size of vector A is

(a) 0

(b) 10

(c) 5000

(d) 1

6. If A is an STL vector, then the effect of executing the statement

A.push_back( x );

is to (a)

(a) check whether the capacity of A is larger than the size of A, enlarges A if necessary, and append x to A

上一页第9页

你可能喜欢

热门文档

相关文档

  • 数据结构试题库集及答案

    数据结构试题库集及答案_IT认证_资格考试/认证_教育专区。数据结构试题库及答案 第一章 概论一、选择题 1、研究数据结构就是研究( D )。 A. 数据的逻辑结构 ...

  • 数据结构题库

    第一章 概论一、选择题 1、研究数据结构就是研究( D )。 A. 数据的逻辑结构 B. 数据的存储结构 C. 数据的逻辑结构和存储结构 D. 数据的逻辑结构、存储...

  • 数据结构试题库答案

    数据结构试题库答案 隐藏>> 数据结构试题及答案 一、单项选择题 (1) 一个算法应该是( A) 程序 C) 要满足五个基本属性 (2) 算法指的是( A) 计算机程序 ...

  • 数据结构试题库答案

    数据结构试题库答案_理学_高等教育_教育专区。一些试题数据结构试题及答案一、单项选择题 (1) 一个算法应该是( A) 程序 C) 要满足五个基本属性 (2) 算法指的...

  • 数据结构试题库

    数据结构试题库_工学_高等教育_教育专区。数据结构一、选择题 1.采用折半查找方法进行查找,数据文件应为( A.有序表 顺序存储结构 C.随机表 顺序存储结构 2.算法...

  • 数据结构试题库(复习题)

    线性,树,图 3.数据结构 S 中:元素的集合为:{A,B,C,D,E,F,G,H,I},关系的集合为:{<A,B>, <A,C>, <B,D>, <B,E>, <B,F>, <C,G>, ...

  • 数据结构试题库及答案

    数据结构试题库及答案_工学_高等教育_教育专区。数据结构试题库及答案一、单选题(每题 2 分,共 20 分) 1.栈和队列的共同特点是( A )。 A.只允许在端点处...

  • 数据结构题库

    数据结构题库 数据结构题数据结构题隐藏>> 第一章 绪论 一、选择题 1、数据结构是一门研究非数值计算的程序设计问题中计算机的 ① A、数据元素 ② A、结构 B...

  • 数据结构题库

    数据结构题库数据结构题库隐藏>> 第1 章 绪论一、选择题 1. 算法的计算量的大小称为计算的( )。 A.效率 B. 复杂性 C. 现实性 D. 难度 2. 算法的时间...

站点地图 | 文档上传 | 侵权投诉 | 手机版
本站所有资源均来自互联网,本站只负责收集和整理,均不承担任何法律责任,如有侵权等其它行为请联系我们.
文档下载 Copyright 2013 doc.guandang.net All Rights Reserved.  -  email