Deque Push Both Ends
easyQuestion 486A deque<int> named d has already been created, and a loop that prints every element separated by spaces is already written below the comment.
Call d.push_back(1), then d.push_back(2), then d.push_front(0). The print loop then produces the output shown in Expected Output.
Expected output
0 1 2= 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.