C program to implement queue operations

Tuesday, June 5th, 2012  »  Posted By  »  Total 0 Comment

Below is the C program to implement various queue operations, 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 […]

C++ program to implement Queue using Linked Representation

Monday, January 31st, 2011  »  Posted By  »  Total 3 Comments

#include <iostream.h> template<class T> class Node { friend LinkedQueue<T>; private: T data; Node<T> *link; }; template<class T> class LinkedQueue { public: LinkedQueue() {front = rear = 0;} // constructor ~LinkedQueue(); // destructor int IsEmpty() const {return ((front) ? 0 : 1);} T First() const; // return first element T Last() const; // return last element […]

C++ program to implement Queue using Formula Based Representation

Monday, January 31st, 2011  »  Posted By  »  Total 0 Comment

#include <iostream.h> #include <conio.h> class queue { private :   int *arr ; int front, rear ; int MAX ; public : queue( int maxsize = 10 ) ; void addq ( int item ) ; int delq( ) ; } ; queue :: queue( int maxsize ) { MAX = maxsize ; arr = […]

C++ program to implement the Queue ADT using a single linked list

Thursday, March 11th, 2010  »  Posted By  »  Total 5 Comments

/* Write C++ programs to implement the Queue ADT using a singly linked list */ #include<iostream> #include<conio.h> #include<stdlib.h> using namespace std; class node { public: class node *next; int data; };   class queue : public node { node *head; int front,rare; public: queue() { front=-1; rare=-1; } void push(int x) { if (rare < […]

C++ programs to implement the Queue ADT using an array

Wednesday, March 10th, 2010  »  Posted By  »  Total 14 Comments

/* Write C++ programs to implement the Queue ADT using an array */ #include<iostream> #include<conio.h> #include<stdlib.h> using namespace std;   class queue { int queue1[5]; int rear,front; public: queue() { rear=-1; front=-1; } void insert(int x) { if(rear > 4) { cout <<"queue over flow"; front=rear=-1; return; } queue1[++rear]=x; cout <<"inserted" <<x; } void delet() […]

Question and Answer
C/C++ Unix & Linux Wordpress
Source codes
C C++ Java

Free email signup

Email: