Priority Queue STL

Q3. Priority Queue#3
Consider the following code:

struct comp{
    bool operator()(string x, string y)
    {
        return x.length() < y.length();
    }
};

int main()
{
    priority_queue, comp> pq;
    return 0;
}

Choose the correct option :

Compile time error due to comp being a struct instead of class.

No compile time error and deque simply instructs STL to use the deque underlying container for the priority queue. vector and queue instead of deque will work too.

No compile time error and deque simply instructs STL to use the deque underlying container for the priority queue. vector instead of deque will work too.

Compile time error due to using deque as the underlying container, we may only use vector or

what is the answer

this line gives a error

okay…

priority_queue, comp> pq;

What this line means? I never see like this code.

Is it mean, like priority_queue<string,vector<string>,comp> pq;

yes i guess there is some misprint
i need to check it once with the team

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.