CJCoding With Joseph
15free / daySign inCreate account

Deque Push Both Ends

A 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 — print one after the last line.

Hints3 available
Topics:
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.