Deck 13: Standard Template Library (STL) II

Full screen (f)
exit full mode
Question
The class pair has two constructors: the default constructor and a constructor with two parameters.
Use Space or
up arrow
down arrow
to flip the card.
Question
Every object of type pair has two data members, first and second, and these two data members are private.
Question
Because the data members of an object of type pair are private, each object of type pair can directly access these data members in a program.
Question
With the help of the function make_pair, we can create pairs without explicitly specifying the type pair.
Question
Elements in an associative container are automatically sorted according to some ordering criteria.
Question
Elements in an associative container are not sorted automatically.
Question
Both the containers set and multiset automatically sort their elements according to some sort criteria.
Question
The only difference between the containers map and multimap is that the container map allows duplicates, whereas the multimap container does not.
Question
The definition of the class implementing a specific container is contained in the header file.
Question
Nonmodifying algorithms do not modify the elements of the container.
Question
To make the generic algorithms flexible, the STL usually provides three forms of an algorithm using the mechanism of function overloading.
Question
The STL relational function objects can also be applied to containers.
Question
Predicates are special types of function objects that return Boolean values.
Question
The STL provides four insert iterators to insert elements at a destination.
Question
The functions generate and generate_n are used to generate elements and fill a sequence.
Question
The function remove is used to remove the elements from a sequence by using some criteria.
Question
The algorithm find_adjacent is used to find the first occurrence of consecutive elements that meet certain criteria.
Question
The algorithm reverse reverses the order of the elements in a given range.
Question
The algorithm count_if counts the occurrences of a given value in a given range satisfying a certain criterion.
Question
The algorithm maxi is used to determine the maximum of two values.
Question
The algorithm min is used to determine the minimum of two values.
Question
The first form of the function transform has three parameters.
Question
The second form of the function transform has three parameters.
Question
The algorithms includes (subset), set_intersection, set_union, set_difference, and set_symmetric_difference assume that the elements within each given range are not sorted.
Question
The algorithms accumulate, adjacent_difference, inner_product, and partial_sum are numerical functions and manipulate numeric data.
Question
With the help of the ____, two values can be combined into a single unit and, therefore, can be treated as one unit.

A) class tuple
B) class unit
C) class pair
D) class double
Question
A function can return two values by using the ____.

A) class tuple
B) class pair
C) class double
D) class unit
Question
The definition of the class pair is contained in the header file utility, thus, to use the class pair in a program, the program must include the following statement ____.

A) include <util/utility>
B) include <utility.h>
C) include <compat/utility>
D) include <utility>
Question
The general syntax to declare an object of type pair is ____.

A) pair<Type1, Type2> pElement;
B) pair pElement<Type1, Type2>;
C) pair.{Type1, Type2} pElement;
D) pair{Type1, Type2} pElement;
Question
The statement ____ assigns 50 to the data member first of x.

A) x.first(50);
B) x.first = 50;
C) first(x) = 50;
D) x.value("first") = 50;
Question
The header file ____ contains the definition of the function template make_pair.

A) utils
B) atl2
C) atl_utility
D) utility
Question
The default ordering criterion for the elements in an associative container is the relational operator ____.

A) >=
B) <=
C) >
D) <
Question
A convenient and fast way to implement an associative container data structure is to use a ____.

A) linked list
B) binary search tree
C) priority queue
D) hash table
Question
The containers map and multimap manage their elements in the form ____.

A) key/pair
B) name/value
C) value/pair
D) index/key
Question
The ____ contains algorithms that only look at the elements in a container and that move the elements of a container.

A) ATL
B) DTL
C) ASTL
D) STL
Question
Modifying algorithms that change the order of the elements, not their values, are also called ____.

A) polymorphic algorithms
B) associative algorithms
C) compensating algorithms
D) mutating algorithms
Question
A ____ contains a function that can be treated as a function using the function call operator, ().

A) function object
B) reference object
C) property object
D) value object
Question
The first form of ____ uses the equality criteria.

A) adjacent_search
B) adjacent_query
C) adjacent_find
D) adjacent_criteria
Question
The algorithm ____ merges the sorted lists.

A) combine
B) merge
C) resort
D) concatenate
Question
The algorithm ____ reverses the elements of a given range while copying into a destination range.

A) copy_reverse
B) inverse_copy
C) copy
D) reverse_copy
Question
The algorithms reverse, reverse_copy, rotate, and rotate_copy are contained in the header file ____.

A) utility
B) structures
C) algorithm
D) operations
Question
The algorithm ____ counts the occurrences of a given value in a given range.

A) count
B) reverse
C) index
D) rotate
Question
The algorithm ____ is used to determine the largest element in a given range.

A) min_element
B) max_element
C) count
D) top_element
Question
The algorithm ____ is used to randomly order the elements in a given range.

A) reorder_shuffle
B) shuffle
C) order_shuffle
D) random_shuffle
Question
The algorithm ____ is used to access and process each element in a given range by applying a function, which is passed as a parameter.

A) with_each
B) do_each
C) for_each
D) for
Question
The algorithm ____ determines whether the elements in one range appear in another range.

A) includes
B) contains
C) has
D) associates
Question
The algorithm ____ is used to find the elements that are contained in two ranges of elements.

A) find_union
B) union
C) set_union
D) has_union
Question
The algorithm ____ is used to find the elements in one range of elements that do not appear in another range of elements.

A) set_union
B) set_difference
C) set_join
D) set_innerjoin
Question
In the second form of ____, the binary operation op is applied to the elements in the range.

A) adjacent_find
B) adjacent_connect
C) adjacent_member
D) adjacent_difference
Question
The algorithm ____ is used to manipulate the elements of two ranges.

A) inner_product
B) outer_product
C) inner_join
D) cross_product
Unlock Deck
Sign up to unlock the cards in this deck!
Unlock Deck
Unlock Deck
1/50
auto play flashcards
Play
simple tutorial
Full screen (f)
exit full mode
Deck 13: Standard Template Library (STL) II
1
The class pair has two constructors: the default constructor and a constructor with two parameters.
True
2
Every object of type pair has two data members, first and second, and these two data members are private.
False
3
Because the data members of an object of type pair are private, each object of type pair can directly access these data members in a program.
False
4
With the help of the function make_pair, we can create pairs without explicitly specifying the type pair.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
5
Elements in an associative container are automatically sorted according to some ordering criteria.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
6
Elements in an associative container are not sorted automatically.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
7
Both the containers set and multiset automatically sort their elements according to some sort criteria.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
8
The only difference between the containers map and multimap is that the container map allows duplicates, whereas the multimap container does not.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
9
The definition of the class implementing a specific container is contained in the header file.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
10
Nonmodifying algorithms do not modify the elements of the container.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
11
To make the generic algorithms flexible, the STL usually provides three forms of an algorithm using the mechanism of function overloading.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
12
The STL relational function objects can also be applied to containers.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
13
Predicates are special types of function objects that return Boolean values.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
14
The STL provides four insert iterators to insert elements at a destination.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
15
The functions generate and generate_n are used to generate elements and fill a sequence.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
16
The function remove is used to remove the elements from a sequence by using some criteria.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
17
The algorithm find_adjacent is used to find the first occurrence of consecutive elements that meet certain criteria.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
18
The algorithm reverse reverses the order of the elements in a given range.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
19
The algorithm count_if counts the occurrences of a given value in a given range satisfying a certain criterion.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
20
The algorithm maxi is used to determine the maximum of two values.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
21
The algorithm min is used to determine the minimum of two values.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
22
The first form of the function transform has three parameters.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
23
The second form of the function transform has three parameters.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
24
The algorithms includes (subset), set_intersection, set_union, set_difference, and set_symmetric_difference assume that the elements within each given range are not sorted.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
25
The algorithms accumulate, adjacent_difference, inner_product, and partial_sum are numerical functions and manipulate numeric data.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
26
With the help of the ____, two values can be combined into a single unit and, therefore, can be treated as one unit.

A) class tuple
B) class unit
C) class pair
D) class double
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
27
A function can return two values by using the ____.

A) class tuple
B) class pair
C) class double
D) class unit
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
28
The definition of the class pair is contained in the header file utility, thus, to use the class pair in a program, the program must include the following statement ____.

A) include <util/utility>
B) include <utility.h>
C) include <compat/utility>
D) include <utility>
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
29
The general syntax to declare an object of type pair is ____.

A) pair<Type1, Type2> pElement;
B) pair pElement<Type1, Type2>;
C) pair.{Type1, Type2} pElement;
D) pair{Type1, Type2} pElement;
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
30
The statement ____ assigns 50 to the data member first of x.

A) x.first(50);
B) x.first = 50;
C) first(x) = 50;
D) x.value("first") = 50;
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
31
The header file ____ contains the definition of the function template make_pair.

A) utils
B) atl2
C) atl_utility
D) utility
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
32
The default ordering criterion for the elements in an associative container is the relational operator ____.

A) >=
B) <=
C) >
D) <
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
33
A convenient and fast way to implement an associative container data structure is to use a ____.

A) linked list
B) binary search tree
C) priority queue
D) hash table
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
34
The containers map and multimap manage their elements in the form ____.

A) key/pair
B) name/value
C) value/pair
D) index/key
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
35
The ____ contains algorithms that only look at the elements in a container and that move the elements of a container.

A) ATL
B) DTL
C) ASTL
D) STL
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
36
Modifying algorithms that change the order of the elements, not their values, are also called ____.

A) polymorphic algorithms
B) associative algorithms
C) compensating algorithms
D) mutating algorithms
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
37
A ____ contains a function that can be treated as a function using the function call operator, ().

A) function object
B) reference object
C) property object
D) value object
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
38
The first form of ____ uses the equality criteria.

A) adjacent_search
B) adjacent_query
C) adjacent_find
D) adjacent_criteria
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
39
The algorithm ____ merges the sorted lists.

A) combine
B) merge
C) resort
D) concatenate
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
40
The algorithm ____ reverses the elements of a given range while copying into a destination range.

A) copy_reverse
B) inverse_copy
C) copy
D) reverse_copy
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
41
The algorithms reverse, reverse_copy, rotate, and rotate_copy are contained in the header file ____.

A) utility
B) structures
C) algorithm
D) operations
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
42
The algorithm ____ counts the occurrences of a given value in a given range.

A) count
B) reverse
C) index
D) rotate
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
43
The algorithm ____ is used to determine the largest element in a given range.

A) min_element
B) max_element
C) count
D) top_element
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
44
The algorithm ____ is used to randomly order the elements in a given range.

A) reorder_shuffle
B) shuffle
C) order_shuffle
D) random_shuffle
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
45
The algorithm ____ is used to access and process each element in a given range by applying a function, which is passed as a parameter.

A) with_each
B) do_each
C) for_each
D) for
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
46
The algorithm ____ determines whether the elements in one range appear in another range.

A) includes
B) contains
C) has
D) associates
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
47
The algorithm ____ is used to find the elements that are contained in two ranges of elements.

A) find_union
B) union
C) set_union
D) has_union
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
48
The algorithm ____ is used to find the elements in one range of elements that do not appear in another range of elements.

A) set_union
B) set_difference
C) set_join
D) set_innerjoin
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
49
In the second form of ____, the binary operation op is applied to the elements in the range.

A) adjacent_find
B) adjacent_connect
C) adjacent_member
D) adjacent_difference
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
50
The algorithm ____ is used to manipulate the elements of two ranges.

A) inner_product
B) outer_product
C) inner_join
D) cross_product
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
locked card icon
Unlock Deck
Unlock for access to all 50 flashcards in this deck.