Complete the code to add an element to the end of the queue.
std::queue<int> q;
q.push([1]);The push function adds an element to the back of the queue. Here, 5 is added.
Complete the code to remove the front element from the queue.
std::queue<int> q; q.push(10); q.push(20); q.[1]();
The pop() function removes the front element from the queue.
Fix the error in accessing the front element of the queue.
std::queue<int> q; q.push(15); int x = q.[1]();
The front() function returns the front element without removing it.
Fill both blanks to check if the queue is empty and then add an element.
if (q.[1]()) { q.[2](100); }
empty() checks if the queue has no elements. If true, push() adds 100 to the queue.
Fill all three blanks to print and remove all elements from the queue.
while (!q.[1]()) { std::cout << q.[2]() << ' '; q.[3](); }
Loop runs while queue is not empty (empty() returns false). front() accesses the element to print, and pop() removes it.
