← Back to STL Containers
Question 486
Deque Push Both Ends
Deque Push Both Ends
Adeque<int>nameddhas already been created, and a loop that prints every element separated by spaces is already written below the comment. Calld.push_back(1), thend.push_back(2), thend.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 — 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.