Filters
Question type

Study Flashcards

A(n) __________ is like a pointer. It is used to access the individual data elements in a container.


A) element access operator
B) subscript indicator
C) global data finder
D) iterator
E) None of these

F) A) and E)
G) None of the above

Correct Answer

verifed

verified

A vector is an associative container that works like an array but is dynamic in size.

A) True
B) False

Correct Answer

verifed

verified

A mutable iterator gives you read/write access to the element to which the iterator points.

A) True
B) False

Correct Answer

verifed

verified

A sequence container that is dynamic in size is a(n)


A) array
B) map
C) vector
D) multimap
E) None of these

F) C) and D)
G) None of the above

Correct Answer

verifed

verified

C

Because the array class's [] operator will perform bounds checking, it is acceptable to use a subscript that is out of bounds.

A) True
B) False

Correct Answer

verifed

verified

Select all that apply. Which of the following statement(s) is(are) not true?


A) A map is an associative container.
B) Each element in a map has two parts.
C) Map elements are usually referred to as key-value pairs.
D) The key value in a map is used to locate a value.
E) The value element in a map is used to locate the key.

F) A) and E)
G) B) and C)

Correct Answer

verifed

verified

To use the binary_search() algorithm you need to include ___________


A) two arguments which are iterators
B) two header files, algorithm.h and search.h
C) three arguments which are two iterators and a value
D) one argument which is a value
E) None of these

F) B) and E)
G) A) and B)

Correct Answer

verifed

verified

Which of the following types of iterators is(are) not supported by the vector class?


A) const_iterator
B) reverse_iterator
C) const_reverse_iterator
D) All of these are supported by the vector class
E) None of these are supported by the vector class

F) B) and C)
G) A) and E)

Correct Answer

verifed

verified

A technique introduced by C++11 to improve runtime performance is known as


A) insertion
B) emplacement
C) push
D) multimove
E) None of these

F) A) and D)
G) A) and C)

Correct Answer

verifed

verified

Select all that apply. Which of the following are types of iterators?


A) input and output
B) forward and bidirectional
C) random-access
D) None of these

E) A) and B)
F) A) and C)

Correct Answer

verifed

verified

The Standard Template Library (STL) contains templates for useful algorithms and data structures.

A) True
B) False

Correct Answer

verifed

verified

To improve runtime performance, C++11 introduced a new family of member functions that use the emplacement technique to insert new elements.

A) True
B) False

Correct Answer

verifed

verified

True

To retrieve a value from a map, you call the __________ member function and pass the __________ that is associated with the desired value.


A) at() , key
B) at() , value
C) key() , key
D) pair() , key
E) None of these

F) A) and B)
G) None of the above

Correct Answer

verifed

verified

An associative container stores data in a nonsequential way so it is slower to locate elements than a sequence container.

A) True
B) False

Correct Answer

verifed

verified

A sequence container organizes data in a sequential fashion, similar to an array.

A) True
B) False

Correct Answer

verifed

verified

Select all that apply. An object of a class that overloads the function call operator is a(n)


A) call operator
B) function object
C) functor
D) overloader object

E) B) and D)
F) B) and C)

Correct Answer

verifed

verified

The three sequence container objects provided by the STL are


A) set, multiset, and map
B) vector, deque, and list
C) map, list, and array
D) multimap, map, and multilist
E) None of these

F) A) and D)
G) A) and C)

Correct Answer

verifed

verified

To use the map class, you must include


A) #include<key>
B) #include<key_value>
C) #include<map>
D) #include<multimap>
E) None of these

F) B) and D)
G) B) and C)

Correct Answer

verifed

verified

When an element is stored in a map, it is stored as an object of the __________ type.


A) map
B) key
C) pair
D) key_value
E) None of these

F) A) and D)
G) B) and C)

Correct Answer

verifed

verified

C

Which of the following defines an array object that holds three strings?


A) array<int, 3> items = {blue, green, yellow}
B) array<strings, 4> items = {'blue', 'green', 'yellow',}
C) array<string, 4> items = {"blue", "green", "yellow"}
D) array<4> string items {"blue", "green", "yellow"}
E) None of these

F) B) and C)
G) A) and E)

Correct Answer

verifed

verified

Showing 1 - 20 of 38

Related Exams

Show Answer