Deck 21: Standard Template Library

Full screen (f)
exit full mode
Question
A ____ is a sequence container.

A) vector
B) stack
C) queue
D) set
Use Space or
up arrow
down arrow
to flip the card.
Question
____ returns the maximum number of elements that can be inserted into the vector container vecCont without reallocation.

A) vecCont.size()
B) vecCont.max_size()
C) vecCont.capacity()
D) vecCont.length()
Question
A container's ____ executes when the object goes out of scope.

A) default constructor
B) destructor
C) copy constructor
D) iterator
Question
Functions begin and end do not take any parameters.
Question
The name of the class that implements the vector container is container.
Question
The container member function ____ returns the position of one past the last element in the container.

A) last
B) end
C) back
D) pop
Question
The ____ operation returns a pointer to the position before the first element in container ct.

A) ct.front()
B) ct.rbegin()
C) ct.rend()
D) ct.end()
Question
If the data needs to be processed in a(n) ____ manner, use a queue.

A) FILO
B) LILO
C) LIFO
D) FIFO
Question
All containers use the same names for the common operations.
Question
The vector container stores and manages its objects in a dynamic array.
Question
Input iterators, with read access, step forward element by element.
Question
An iterator to a vector container is declared using the ____ iterator.

A) new
B) vector
C) typedef
D) typeiter
Question
Every object in a(n) ____ container has a specific position.

A) adapter
B) sequence
C) associative
D) static
Question
The definition of the function template copy is contained in the header file ____.

A) algorithm
B) copy
C) ioinput
D) std
Question
The first element in a vector container is at location 1.
Question
You must use the container name, the container element type, and the scope resolution operator to use the typedef iterator.
Question
If data needs to be processed in a LIFO manner, use a ____.

A) stack
B) linked list
C) queue
D) deque
Question
The deq.front() operation on a deque object checks whether the container is empty.
Question
The ____ operation on a vector container deletes the last element.

A) vecList.pop_back()
B) vecList.pop()
C) vecList.push_back()
D) vecList.back()
Question
The STL has three main components: ____.

A) containers, iterators, and algorithms
B) functions, iterators, and algorithms
C) containers, constants, and algorithms
D) containers, iterators, and procedures
Question
Random access iterators are ____ iterators that can randomly process the elements of a container.

A) bidirectional
B) forward
C) input
D) output
Question
The class ____ contains the definition of an output stream iterator.

A) iostream
B) iostream_iterator
C) ostream
D) ostream_iterator
Question
The ____________________ iterators are used to output data from a program into an output stream.
Question
The ____ typedef iterator is common to all containers.

A) random_access
B) bidirectional
C) pointer
D) forward
Question
Predicates are special types of function objects that return ____ values.

A) character
B) string
C) Boolean
D) Integer
Question
In the ____ sort algorithm, the array containing the data is viewed as a binary tree.

A) modifying
B) heap
C) nonmodifying
D) numeric
Question
If consecutive elements in listCont have the same value, the ____ operation removes the duplicates.

A) listCont.remove()
B) listCont.duplicate()
C) listCont.remove(duplicate)
D) listCont.unique()
Question
The ____ operation removes the first element from the deque object deq.

A) deq.front()
B) deq.push_front()
C) deq.pop_front()
D) deq.push()
Question
Elements in a(n) ____ container are automatically sorted according to some ordering criteria.

A) sequence
B) associative
C) sorted
D) adapter
Question
____ is a modifying algorithm.

A) min
B) find
C) merge
D) count
Question
____ is a nonmodifying algorithm.

A) equal
B) copy
C) fill
D) sort
Question
If a container is declared as ____, then we must prevent the iterator from modifying the elements of the container, especially accidentally.

A) static
B) const
C) public
D) private
Question
The associated header file of the sequence container multimap is ____________________.
Question
The only difference between the containers set and multiset is that the container multiset allows ____________________.
Question
List containers are implemented as doubly ____________________.
Question
A function object contains a function that can be treated as a function using the ____ operator.

A) *
B) ::
C) ()
D) .
Question
The expression ct.____________________ deletes all of the elements from the container ct.
Question
____________________ iterators are forward iterators that can also iterate backward over the elements.
Question
____ containers allow elements to be inserted at both ends.

A) Queue
B) Deque
C) Stack
D) List
Question
Every container contains the typedef ____________________.An iterator of this type is used to iterate through the elements of a container in reverse.
Question
____________________ predicates check a specific property for a single argument.
Unlock Deck
Sign up to unlock the cards in this deck!
Unlock Deck
Unlock Deck
1/41
auto play flashcards
Play
simple tutorial
Full screen (f)
exit full mode
Deck 21: Standard Template Library
1
A ____ is a sequence container.

A) vector
B) stack
C) queue
D) set
A
2
____ returns the maximum number of elements that can be inserted into the vector container vecCont without reallocation.

A) vecCont.size()
B) vecCont.max_size()
C) vecCont.capacity()
D) vecCont.length()
C
3
A container's ____ executes when the object goes out of scope.

A) default constructor
B) destructor
C) copy constructor
D) iterator
B
4
Functions begin and end do not take any parameters.
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
5
The name of the class that implements the vector container is container.
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
6
The container member function ____ returns the position of one past the last element in the container.

A) last
B) end
C) back
D) pop
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
7
The ____ operation returns a pointer to the position before the first element in container ct.

A) ct.front()
B) ct.rbegin()
C) ct.rend()
D) ct.end()
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
8
If the data needs to be processed in a(n) ____ manner, use a queue.

A) FILO
B) LILO
C) LIFO
D) FIFO
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
9
All containers use the same names for the common operations.
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
10
The vector container stores and manages its objects in a dynamic array.
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
11
Input iterators, with read access, step forward element by element.
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
12
An iterator to a vector container is declared using the ____ iterator.

A) new
B) vector
C) typedef
D) typeiter
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
13
Every object in a(n) ____ container has a specific position.

A) adapter
B) sequence
C) associative
D) static
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
14
The definition of the function template copy is contained in the header file ____.

A) algorithm
B) copy
C) ioinput
D) std
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
15
The first element in a vector container is at location 1.
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
16
You must use the container name, the container element type, and the scope resolution operator to use the typedef iterator.
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
17
If data needs to be processed in a LIFO manner, use a ____.

A) stack
B) linked list
C) queue
D) deque
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
18
The deq.front() operation on a deque object checks whether the container is empty.
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
19
The ____ operation on a vector container deletes the last element.

A) vecList.pop_back()
B) vecList.pop()
C) vecList.push_back()
D) vecList.back()
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
20
The STL has three main components: ____.

A) containers, iterators, and algorithms
B) functions, iterators, and algorithms
C) containers, constants, and algorithms
D) containers, iterators, and procedures
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
21
Random access iterators are ____ iterators that can randomly process the elements of a container.

A) bidirectional
B) forward
C) input
D) output
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
22
The class ____ contains the definition of an output stream iterator.

A) iostream
B) iostream_iterator
C) ostream
D) ostream_iterator
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
23
The ____________________ iterators are used to output data from a program into an output stream.
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
24
The ____ typedef iterator is common to all containers.

A) random_access
B) bidirectional
C) pointer
D) forward
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
25
Predicates are special types of function objects that return ____ values.

A) character
B) string
C) Boolean
D) Integer
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
26
In the ____ sort algorithm, the array containing the data is viewed as a binary tree.

A) modifying
B) heap
C) nonmodifying
D) numeric
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
27
If consecutive elements in listCont have the same value, the ____ operation removes the duplicates.

A) listCont.remove()
B) listCont.duplicate()
C) listCont.remove(duplicate)
D) listCont.unique()
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
28
The ____ operation removes the first element from the deque object deq.

A) deq.front()
B) deq.push_front()
C) deq.pop_front()
D) deq.push()
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
29
Elements in a(n) ____ container are automatically sorted according to some ordering criteria.

A) sequence
B) associative
C) sorted
D) adapter
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
30
____ is a modifying algorithm.

A) min
B) find
C) merge
D) count
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
31
____ is a nonmodifying algorithm.

A) equal
B) copy
C) fill
D) sort
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
32
If a container is declared as ____, then we must prevent the iterator from modifying the elements of the container, especially accidentally.

A) static
B) const
C) public
D) private
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
33
The associated header file of the sequence container multimap is ____________________.
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
34
The only difference between the containers set and multiset is that the container multiset allows ____________________.
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
35
List containers are implemented as doubly ____________________.
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
36
A function object contains a function that can be treated as a function using the ____ operator.

A) *
B) ::
C) ()
D) .
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
37
The expression ct.____________________ deletes all of the elements from the container ct.
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
38
____________________ iterators are forward iterators that can also iterate backward over the elements.
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
39
____ containers allow elements to be inserted at both ends.

A) Queue
B) Deque
C) Stack
D) List
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
40
Every container contains the typedef ____________________.An iterator of this type is used to iterate through the elements of a container in reverse.
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
41
____________________ predicates check a specific property for a single argument.
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
locked card icon
Unlock Deck
Unlock for access to all 41 flashcards in this deck.