diff --git a/queueusingarray.cpp b/queueusingarray.cpp new file mode 100644 index 0000000..e9f44c9 --- /dev/null +++ b/queueusingarray.cpp @@ -0,0 +1,70 @@ +#include +using namespace std; +#define n 100 + +class Queue{ + + int* arr; + int front; + int back; + +public: + Queue(){ + arr = new int[n]; + front = -1; + back = -1; + } + + void enque(int data){ + if(back == n-1){ + cout<<"Queue Overflow"< back){ + cout<<"No elements in the queue"< back){ + cout<<"No elements in the queue"< back){ + cout<<"No elements in the queue"<