Queue Status
easyQuestion 481Write a function string status(const queue<int>& q) that returns the string "empty" if the queue has no elements, and "not empty" otherwise.
The tests print the returned string on its own line. For a queue holding 1, 2, 3 the output is exactly what is shown in Expected Output.
For a queue with nothing in it the output is: empty
Do NOT write a main function.
Expected output
not empty empty
= newline. The output ends with a newline, so print one after the last line.
Hints3 available
Sign in to use hintsTopics
STL ContainersQueues
1
Tab to indent (Esc then Tab to move on) · Ctrl+Enter to run · Shift+Alt+F to format · Ctrl+Space to expand shortcuts (cout, fori)
Your output
Run your code to see the output here...
Test cases
Run your code to see test case results.