NevLabs

Under Construction

Saturday, January 7, 2012

Queue Implementation using Linked List in C++

#include<iostream.h> #include<conio.h> struct node {  int data;  struct node *link; }; class queue {  struct node *front,*rear,*ptr;  public:  queue(){  rear=NULL;  front=NULL;  }  void enqueue(int);  void dqueue();  void display(); };   void queue::enqueue(int data) {   ptr=new node;   if(rear==NULL)    { front=ptr;    }    else    {     rear->link=ptr;    ...