Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # include<iostream>
- # include<conio.h>
- # define SIZE 90
- using namespace std;
- class queue
- {
- int a[SIZE];
- int front;
- int rear;
- public:
- queue();
- ~queue();
- queue operator+(queue &a);
- queue operator=(queue &);
- friend bool operator==(queue &a,queue &b){
- if(a.rear==b.rear)
- return true;
- else return false;
- }
- friend bool operator!=(queue &a,queue &b){
- if(a.rear==b.rear)
- return false;
- else return true;
- }
- friend bool operator<(queue &a,queue &b){
- if(a.rear<b.rear)
- return true;
- else return false;
- }
- friend bool operator>(queue &a,queue &b){
- if(a.rear>b.rear)
- return true;
- else return false;
- }
- friend ostream& operator<<(ostream &out, queue a){
- out<<a.a[front];
- a.front++;
- return out;
- }
- friend istream& operator>>(istream &in, const queue &a){
- a.rear++;
- in>>a.a[rear];
- return in;
- }
- void insert(int i);
- int remove();
- int isempty();
- int isfull();
- void printQ();
- };
Add Comment
Please, Sign In to add comment