Questions and Answers
- Which of the following class template are based on arrays?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: C
Class template vector and class template dequeue both are based on arrays.
- Which of the following will return the new element at the end of container?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: D
back
- What is the output of this program?
#include <iostream>
#include <deque>
using namespace std;
int main ()
{
deque<int> DequeData (6);
deque<int>::reverse_iterator RevIter = DequeData.rbegin();
int k = 0;
for (RevIter = DequeData.rbegin(); RevIter != DequeData.rend(); ++RevIter)
*RevIter = ++k;
for (deque<int> :: iterator iter = DequeData.begin();
iter != DequeData.end(); ++iter)
cout << ' ' << *iter;
return 0;
}
-
View Hint View Answer Discuss in Forum
NA
Correct Option: E
In this program, We used the operation of rbegin and rend on dequeue and produced the result.
- Which of the following does not support any insertion or deletion?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: C
Because array is not dynamic in nature, So they can’t be manipulated.
- How the list containers are implemented?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: B
List containers are implemented as doubly-linked lists. Doubly linked lists can store each of the elements they contain in different and unrelated storage locations.