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