Questions and Answers


  1. What type of class template is list?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: C

    It is node-based because it allows efficient insertion anywhere on the program.


  1. To what type of object does the container can be instantiated?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: C

    any type of object



  1. What kind of library is Standard Template Library?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: D

    The STL is a generic library, meaning that its components are heavily parameterized.


  1. What is the output of this program?
    #include <iostream>
    #include <set>
    using namespace std;
    int main ()
    {
    multiset<int> MultisetData;
    for (int k = 0; k < 6; k++) MultisetData.insert(k);
    multiset :: key_compare compare = MultisetData.key_comp();
    int highest = *MultisetData.rbegin();
    multiset :: iterator Iter = MultisetData.begin();
    do
    {
    cout << ' ' << *Iter;
    } while (compare(*Iter++, highest));
    return 0;
    }











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: A

    In this program, We used the set template and then we compared the keys and printing the result.



  1. What is the output of this program?
    #include <iostream>
    #include <set>
    using namespace std;
    int main ()
    {
    set<int> SetData;
    SetData.insert(25);
    SetData.insert(15);
    SetData.insert(45);
    SetData.insert(35);
    SetData.insert(55);
    while (!SetData.empty())
    {
    cout << ' ' << *SetData.begin();
    SetData.erase(SetData.begin());
    }
    return 0;
    }











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: E

    In this program, We used the set template and then we are initializing the values and then we are erasing it.