Which of the following member function do all the sequential containers (vector, list, deque) have? In the explanation, tell what the member does/returns.
a. begin()
b. end()
c. rbegin()
d. rend()
e. push_front()
f. pushback()
g. front()
h) back()
All but e).
Explanation: Part a) begin() returns an iterator to the front element, that is, the element returned by the front() member. Part b) end() returns an iterator to the position past the last element, that is, one past the element returned by the back() member. Part c) rbegin() returns an iterator to the position before the first element in the container, that is, one before the element returned by the front() member. Part d) rend() returns an iterator to the position of the last element in the container, that is, the position of the element returned by the back() member. Part e) push_front() takes an argument of the type contained in the container. This member puts the member into the container in a position in front of the first element in the container. Part f) pushback() takes an argument of the type contained in the container. This member puts the member into the container in a position behind the last element in the container, behind the element returned by the back() member function.
You might also like to view...
Which of the following tools can be used to find out what font or font size has been applied to selected text?
A. Text B. Type C. Font D. Font Control
The formula in a cell should use the ________ operation to calculate a total percentage
A) addition B) multiplication C) division D) subtraction
With the VBA ________ control structure, there is virtually no limit to the commands and logic that can be applied
Fill in the blank(s) with correct word
Microwave communication uses high-frequency ________.
A. satellite communications B. radio waves C. infrared D. optic fibers