Queue


#include <queue>                                 // include vector  in code

queue<int> q;                                    // create an empty queue

q.push(10);                                      // Insert element in queue

int head = q.front();                            // head
int tail = q.back();                             // tail

int size = q.size();                             // size of queue

q.pop();                                         // Remove

if(q.empty()){                                   // checks if queue is empty

}
 

Last updated