Loading...
Loading...
Loading Curriculum...
Loading Subject...
Loading Topic...
Loading Lesson...
Loading Lab...
A container adapter following First-In, First-Out (FIFO). Elements are added at the back and removed from the front.
push(val): Adds element to back.pop(): Removes front element.front(): Returns front element.back(): Returns back element.queue<int> q; q.push(10); q.push(20); cout << q.front(); // 10 q.pop(); cout << q.front(); // 20
Used in Breadth-First Search (BFS), task scheduling, printer spooling, and handling asynchronous data streams.