Complete the code to add an element at the front of the deque.
std::deque<int> dq; dq.[1](10);
To add an element at the front of a deque, use push_front.
Complete the code to remove an element from the back of the deque.
std::deque<int> dq = {1, 2, 3};
dq.[1]();To remove an element from the back of a deque, use pop_back.
Fix the error in accessing the first element of the deque.
std::deque<int> dq = {5, 10, 15};
int first = dq.[1]();To access the first element without removing it, use front().
Fill both blanks to insert 20 at the back and then remove from the front.
std::deque<int> dq; dq.[1](20); dq.[2]();
Use push_back to add at the back and pop_front to remove from the front.
Fill all three blanks to create a deque with 1, add 2 at front, then remove first element.
std::deque<int> dq = {1};
dq.[1](2);
dq.[2]();
int last = dq.[3]();Use push_front to add 2 at front, pop_front to remove first element, and back to access last element.
