Questions and Answers


  1. Which of the following class template are based on arrays?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: C

    Class template vector and class template dequeue both are based on arrays.


  1. Which of the following will return the new element at the end of container?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: D

    back



  1. 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;
    }











  1. 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.


  1. Which of the following does not support any insertion or deletion?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: C

    Because array is not dynamic in nature, So they can’t be manipulated.



  1. How the list containers are implemented?











  1. 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.