class Queue{
private:
struct Node{
int data;
Node* node;
};
Node* head;
Node* rear;
int count;
public:
Queue():count(0),head(nullptr),rear(nullptr){}
void push(int data){
Node* node=new Node();
node->data=data;
if(isEmpty()){
head=node;
}else{
rear->next=node;
}
rear=node;
count++;
}
void pop(){
if(isEmpty())return;
Node* node=head;
head=head->next;
delete node;
count--;
}
int front(){
return head->data;
}
bool isEmpty(){
return count==0;
}
};
int main(){
Queue* q=new Queue();
q->push(1);
q->push(2);
q->push(3);
}