<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Queue | Student Projects</title>
	<atom:link href="https://studentprojects.in/tag/queue/feed/" rel="self" type="application/rss+xml" />
	<link>https://studentprojects.in</link>
	<description>Microcontroller projects, Circuit Diagrams, Project Ideas</description>
	<lastBuildDate>Sat, 09 Jun 2012 11:16:18 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.1.7</generator>
	<item>
		<title>C program to implement queue operations</title>
		<link>https://studentprojects.in/software-development/c-tutorials/c/data-structures-c/c-program-to-implement-queue-operations/</link>
					<comments>https://studentprojects.in/software-development/c-tutorials/c/data-structures-c/c-program-to-implement-queue-operations/#respond</comments>
		
		<dc:creator><![CDATA[Drithi]]></dc:creator>
		<pubDate>Tue, 05 Jun 2012 09:43:43 +0000</pubDate>
				<category><![CDATA[Data Structures]]></category>
		<category><![CDATA[queue overflow]]></category>
		<category><![CDATA[queue underflow]]></category>
		<category><![CDATA[queue operations]]></category>
		<category><![CDATA[data structures]]></category>
		<category><![CDATA[Queue]]></category>
		<category><![CDATA[c programs]]></category>
		<guid isPermaLink="false">http://studentprojects.in/?p=3129</guid>

					<description><![CDATA[<p>Below is the C program to implement various queue operations, #include #include #define max 5 int q[10],front=0,rear=-1; void main() { int ch; void insert(); void delet(); void display(); clrscr(); printf("\nQueue operations\n"); printf("1.insert\n2.delete\n3.display\n4.exit\n"); while(1) { printf("Enter your choice:"); scanf("%d",&#038;ch); switch(ch) { case 1: insert(); break; case 2: delet(); break; case 3:display(); break; case 4:exit(); default:printf("Invalid option\n");</p>
<p>The post <a href="https://studentprojects.in/software-development/c-tutorials/c/data-structures-c/c-program-to-implement-queue-operations/">C program to implement queue operations</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>Below is the C program to implement various queue operations,</p>
<pre lang="c" line="1">
#include<stdio.h>
#include<conio.h>
#define max 5
int q[10],front=0,rear=-1;
void main()
{
    int ch;
    void insert();
    void delet();
    void display();
    clrscr();
    printf("\nQueue operations\n");
    printf("1.insert\n2.delete\n3.display\n4.exit\n");
    while(1)
    {
        printf("Enter your choice:");
        scanf("%d",&ch);
        switch(ch)
        {
        case 1: insert();
            break;
        case 2: delet();
            break;
        case 3:display();
            break;
        case 4:exit();
        default:printf("Invalid option\n");
        }
    }
}

void insert()
{
    int x;
    if(rear==max-1)
        printf("Queue is overflow\n");
    else
    {
        printf("Enter element to be insert:");
        scanf("%d",&x);
        q[++rear]=x;
    }
}
void  delet()
{
    int a;
    if((front==0)&&(rear==-1))
    {
        printf("Queue is underflow\n");
        getch();
        exit();
    }
    a=q[front++];
    printf("Deleted element is:%d\n",a);
    if(front>rear)
    {
        front=0;
        rear=-1;
    }
}

void display()
{
    int i;
    if(front==0&&rear==-1)
    {
        printf("Queue is underflow\n");
        getch();
        exit();
    }
    for(i=front;i<=rear;i++)
        printf("\t%d",q[i]);
    printf("\n");
}
getch();
</pre><p>The post <a href="https://studentprojects.in/software-development/c-tutorials/c/data-structures-c/c-program-to-implement-queue-operations/">C program to implement queue operations</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://studentprojects.in/software-development/c-tutorials/c/data-structures-c/c-program-to-implement-queue-operations/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>C++ program to implement Queue using Linked Representation</title>
		<link>https://studentprojects.in/software-development/cpp/cpp-programs/cpp-data-structure/c-program-to-implement-queue-using-linked-representation/</link>
					<comments>https://studentprojects.in/software-development/cpp/cpp-programs/cpp-data-structure/c-program-to-implement-queue-using-linked-representation/#comments</comments>
		
		<dc:creator><![CDATA[Editorial Team]]></dc:creator>
		<pubDate>Mon, 31 Jan 2011 12:14:56 +0000</pubDate>
				<category><![CDATA[Data structure]]></category>
		<category><![CDATA[Linked Representation]]></category>
		<category><![CDATA[Queue]]></category>
		<category><![CDATA[linked list]]></category>
		<category><![CDATA[download]]></category>
		<category><![CDATA[C Programs]]></category>
		<guid isPermaLink="false">http://studentprojects.in/?p=1267</guid>

					<description><![CDATA[<p>#include template class Node { friend LinkedQueue; private: T data; Node *link; }; template 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 LinkedQueue&#038; Add(const T&</p>
<p>The post <a href="https://studentprojects.in/software-development/cpp/cpp-programs/cpp-data-structure/c-program-to-implement-queue-using-linked-representation/">C++ program to implement Queue using Linked Representation</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></description>
										<content:encoded><![CDATA[<pre lang="cpp">
#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
		LinkedQueue<T>& Add(const T& x);
		LinkedQueue<T>& Delete(T& x);
	private:
		Node<T> *front;  // pointer to first node
		Node<T> *rear;   // pointer to last node
};

	template<class T>
LinkedQueue<T>::~LinkedQueue()
{// Queue destructor.  Delete all nodes.
	Node<T> *next;
	while (front) {
		next = front->link;
		delete front;
		front = next;
	}
}
template<class T>
T LinkedQueue<T>::First() const
{
	if (IsEmpty())   { cout<<"OutOfBounds()";  return -1; };
	return front->data;
}
template<class T>
T LinkedQueue<T>::Last() const
{
	if (IsEmpty()) { cout<<"OutOfBounds()";    return -1; };
	return rear->data;
}
	template<class T>
LinkedQueue<T>& LinkedQueue<T>::Add(const T& x)
{
	Node<T> *p = new Node<T>;
	p->data = x;
	p->link = 0;
	if (front) rear->link = p;  // queue not empty
	else front = p;             // queue empty
	rear = p;
	return *this;
}
	template<class T>
LinkedQueue<T>& LinkedQueue<T>::Delete(T& x)
{
	if (IsEmpty()) {  cout<<"OutOfBounds()"; return *this; };
	x = front->data;
	Node<T> *p = front;
	front = front->link;
	delete p;
	return *this;
}
void main(void)
{
	LinkedQueue<int> Q;
	int x;
	Q.Add(1).Add(2).Add(3).Add(4);
	cout << "No queue add failed" << endl;
	cout << "Queue is now 1234" << endl;
	Q.Delete(x);
	cout << "Deleted " << x << endl;
	cout << Q.First() << " is at front" << endl;
	cout << Q.Last() << " is at end" << endl;
	Q.Delete(x);
	cout << "Deleted " << x << endl;
	Q.Delete(x);
	cout << "Deleted " << x << endl;
	Q.Delete(x);
	cout << "Deleted " << x << endl;
	cout << "No queue delete failed " << endl;
}
</pre><p>The post <a href="https://studentprojects.in/software-development/cpp/cpp-programs/cpp-data-structure/c-program-to-implement-queue-using-linked-representation/">C++ program to implement Queue using Linked Representation</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://studentprojects.in/software-development/cpp/cpp-programs/cpp-data-structure/c-program-to-implement-queue-using-linked-representation/feed/</wfw:commentRss>
			<slash:comments>3</slash:comments>
		
		
			</item>
		<item>
		<title>C++ program to implement Queue using Formula Based Representation</title>
		<link>https://studentprojects.in/software-development/cpp/cpp-programs/cpp-data-structure/c-program-to-implement-queue-using-formula-based-representation/</link>
					<comments>https://studentprojects.in/software-development/cpp/cpp-programs/cpp-data-structure/c-program-to-implement-queue-using-formula-based-representation/#respond</comments>
		
		<dc:creator><![CDATA[Editorial Team]]></dc:creator>
		<pubDate>Mon, 31 Jan 2011 12:03:38 +0000</pubDate>
				<category><![CDATA[Data structure]]></category>
		<category><![CDATA[Formula Based Representation]]></category>
		<category><![CDATA[Queue]]></category>
		<category><![CDATA[linked list]]></category>
		<category><![CDATA[download]]></category>
		<category><![CDATA[C Programs]]></category>
		<guid isPermaLink="false">http://studentprojects.in/?p=1265</guid>

					<description><![CDATA[<p>#include #include 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 = new int [</p>
<p>The post <a href="https://studentprojects.in/software-development/cpp/cpp-programs/cpp-data-structure/c-program-to-implement-queue-using-formula-based-representation/">C++ program to implement Queue using Formula Based Representation</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></description>
										<content:encoded><![CDATA[<pre lang="cpp">
#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 = new int [ MAX ];
	front = -1 ;
	rear = -1 ;
}
void queue :: addq ( int item )
{
	if ( rear == MAX - 1 )
	{
		cout << "\nQueue is full" ;
		return ;
	}
	rear++ ;
	arr[rear] = item ;
	if ( front == -1 )
		front = 0 ;
}
int queue :: delq( )
{
	int data ;

	if ( front == -1 )
	{
		cout << "\nQueue is Empty" ;
		return NULL ;
	}

	data = arr[front] ;
	arr[front] = 0 ;
	if ( front == rear )
		front = rear = -1 ;
	else
		front++ ;

	return  data ;
}
void main( )
{
	queue a (10 ) ;
	clrscr();
	a.addq ( 23 ) ;
	a.addq ( 9 ) ;
	a.addq ( 11 ) ;
	a.addq ( -10 ) ;
	a.addq ( 25 ) ;
	a.addq ( 16 ) ;
	a.addq ( 17 ) ;
	a.addq ( 22 ) ;
	a.addq ( 19 ) ;
	a.addq ( 30 ) ;
	a.addq ( 32 ) ;
	int i = a.delq( ) ;
	cout << "\nItem deleted: " << i ;
	i = a.delq( ) ;
	cout << "\nItem deleted: " << i ;
	i = a.delq( ) ;
	cout << "\nItem deleted: " << i ;
}
</pre><p>The post <a href="https://studentprojects.in/software-development/cpp/cpp-programs/cpp-data-structure/c-program-to-implement-queue-using-formula-based-representation/">C++ program to implement Queue using Formula Based Representation</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://studentprojects.in/software-development/cpp/cpp-programs/cpp-data-structure/c-program-to-implement-queue-using-formula-based-representation/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>C++ program to implement the Queue ADT using a single linked list</title>
		<link>https://studentprojects.in/software-development/cpp/cpp-programs/cpp-data-structure/c-program-to-implement-the-queue-adt-using-a-single-linked-list/</link>
					<comments>https://studentprojects.in/software-development/cpp/cpp-programs/cpp-data-structure/c-program-to-implement-the-queue-adt-using-a-single-linked-list/#comments</comments>
		
		<dc:creator><![CDATA[Editorial Team]]></dc:creator>
		<pubDate>Thu, 11 Mar 2010 14:05:19 +0000</pubDate>
				<category><![CDATA[Data structure]]></category>
		<category><![CDATA[Queue]]></category>
		<category><![CDATA[linked list]]></category>
		<category><![CDATA[C++ Programs]]></category>
		<guid isPermaLink="false">http://studentprojects.in/?p=1013</guid>

					<description><![CDATA[<p>/* Write C++ programs to implement the Queue ADT using a singly linked list */ #include #include #include 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 < 0
</p>
<p>The post <a href="https://studentprojects.in/software-development/cpp/cpp-programs/cpp-data-structure/c-program-to-implement-the-queue-adt-using-a-single-linked-list/">C++ program to implement the Queue ADT using a single linked list</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>/* Write C++ programs to implement the Queue ADT using a singly linked list */</p>
<pre lang="cpp">
#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 < 0 )
             		{
               			head =new node;
                  		head->next=NULL;
                    	head->data=x;
                     	rare ++;
                     }
             else
                    {
                    	node *temp,*temp1;
                     	temp=head;
                      	if(rare >= 4)
                          {
                          	cout <<"queue over flow";
                           	return;
                           }
                        rare++;
                        while(temp->next != NULL)
                        	temp=temp->next;
                        temp1=new node;
                        temp->next=temp1;
                        temp1->next=NULL;
                        temp1->data=x;
                    }  }

           void display()
           	{
              node *temp;
              temp=head;
              if (rare < 0)
                {
                    cout <<" queue under flow";
                    return;
                 }
              while(temp != NULL)
               {
               	   cout <<temp->data<< " ";
                   temp=temp->next;
                }
             }
             void pop()
              {
              	node *temp;
               	temp=head;
                if( rare < 0)
                  {
                  	cout <<"queue under flow";
                   	return;
                   }
                if(front == rare)
                  {
                  	front = rare =-1;
                   	head=NULL;
                    return;
                   }
                front++;
                head=head->next;
                }
};
main()
{
	queue s1;
	int ch;
	while(1)
      {
		cout <<"\n1.PUSH\n2.POP\n3.DISPLAY\n4.EXIT\n enter ru choice:";
		cin >> ch;
		switch(ch)
		{
            case 1:
                 	cout <<"\n enter a element";
                  	cin >> ch;
                   	s1.push(ch); break;

            case 2: s1.pop();break;
            case 3: s1.display();break;
        	case 4: exit(0);
		  }
       }
return (0);
}
</pre>
<p><strong>OUTPUT</strong></p>
<p>1.PUSH 2.POP 3.DISPLAY 4.EXIT<br />
 enter ru choice:1<br />
 enter a element23</p>
<p>1.PUSH 2.POP 3.DISPLAY 4.EXIT<br />
 enter ru choice:1<br />
 enter a element54</p>
<p>1.PUSH 2.POP 3.DISPLAY 4.EXIT<br />
 enter ru choice:3<br />
23 54<br />
1.PUSH 2.POP 3.DISPLAY 4.EXIT<br />
 enter ru choice:2</p>
<p>1.PUSH 2.POP 3.DISPLAY 4.EXIT<br />
 enter ru choice:2</p>
<p>1.PUSH 2.POP 3.DISPLAY 4.EXIT<br />
 enter ru choice:2<br />
queue under flow<br />
1.PUSH 2.POP 3.DISPLAY 4.EXIT<br />
 enter ru choice:4</p><p>The post <a href="https://studentprojects.in/software-development/cpp/cpp-programs/cpp-data-structure/c-program-to-implement-the-queue-adt-using-a-single-linked-list/">C++ program to implement the Queue ADT using a single linked list</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://studentprojects.in/software-development/cpp/cpp-programs/cpp-data-structure/c-program-to-implement-the-queue-adt-using-a-single-linked-list/feed/</wfw:commentRss>
			<slash:comments>9</slash:comments>
		
		
			</item>
		<item>
		<title>C++ programs to implement the Queue ADT using an array</title>
		<link>https://studentprojects.in/software-development/cpp/cpp-programs/cpp-data-structure/c-programs-to-implement-the-queue-adt-using-an-array/</link>
					<comments>https://studentprojects.in/software-development/cpp/cpp-programs/cpp-data-structure/c-programs-to-implement-the-queue-adt-using-an-array/#comments</comments>
		
		<dc:creator><![CDATA[Editorial Team]]></dc:creator>
		<pubDate>Wed, 10 Mar 2010 17:30:22 +0000</pubDate>
				<category><![CDATA[Data structure]]></category>
		<category><![CDATA[Queue]]></category>
		<category><![CDATA[c programs]]></category>
		<guid isPermaLink="false">http://studentprojects.in/?p=1007</guid>

					<description><![CDATA[<p>/* Write C++ programs to implement the Queue ADT using an array */ #include #include #include 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</p>
<p>The post <a href="https://studentprojects.in/software-development/cpp/cpp-programs/cpp-data-structure/c-programs-to-implement-the-queue-adt-using-an-array/">C++ programs to implement the Queue ADT using an array</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>/* Write C++ programs to implement the Queue ADT using an array */</p>
<pre lang="cpp">
#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()
               {
                   if(front==rear)
                     {
                         cout <<"queue under flow";
                         return;
                     }
                     cout <<"deleted" <<queue1[++front];
                }
              void display()
               {
                   if(rear==front)
                     {
                          cout <<" queue empty";
                          return;
                     }
                   for(int i=front+1;i<=rear;i++)
                   cout <<queue1[i]<<" ";
               }
};

main()
{
      int ch;
      queue qu;
      while(1)
        {
              cout <<"\n1.insert  2.delet  3.display  4.exit\nEnter ur choice";
              cin >> ch;
              switch(ch)
                {
                  case 1:    cout <<"enter the element";
                           	 cin >> ch;
                             qu.insert(ch);
                             break;
                  case 2:  qu.delet();  break;
                  case 3:  qu.display();break;
                  case 4: exit(0);
                  }
          }
return (0);
}
</pre>
<p><strong>OUTPUT</strong><br />
1.insert  2.delet  3.display  4.exit<br />
Enter ur choice1<br />
enter the element21<br />
inserted21</p>
<p>1.insert  2.delet  3.display  4.exit<br />
Enter ur choice1<br />
enter the element22<br />
inserted22</p>
<p>1.insert  2.delet  3.display  4.exit<br />
Enter ur choice1<br />
enter the element16<br />
inserted16</p>
<p>1.insert  2.delet  3.display  4.exit<br />
Enter ur choice3<br />
21 22 16 </p>
<p>1.insert  2.delet  3.display  4.exit<br />
Enter ur choice2<br />
deleted21</p>
<p>1.insert  2.delet  3.display  4.exit<br />
Enter ur choice3<br />
22 16</p>
<p>1.insert  2.delet  3.display  4.exit<br />
Enter ur choice</p><p>The post <a href="https://studentprojects.in/software-development/cpp/cpp-programs/cpp-data-structure/c-programs-to-implement-the-queue-adt-using-an-array/">C++ programs to implement the Queue ADT using an array</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://studentprojects.in/software-development/cpp/cpp-programs/cpp-data-structure/c-programs-to-implement-the-queue-adt-using-an-array/feed/</wfw:commentRss>
			<slash:comments>23</slash:comments>
		
		
			</item>
	</channel>
</rss>
