Queue Operations Using Linked List - The Code Cracker
Queue Operations Using Linked List - The Code Cracker
http://thecodecracker.com/c-programming/queue-operations-using-link...
SEARCH
Search
RSS Feed
Facebook Google+
TAGS
Arithmetic Operations
#include<stdio.h> #include<malloc.h> #define MAXSIZE 10 void insertion(); void deletion(); void display(); struct node { int info; struct node *link; }*new,*temp,*p,*front=NULL,*rear=NULL; typedef struct node N; main() { int ch;
Armstrong Number
Array
Call By Reference
Call By Value Data Structure and Algorithm
Data
12/24/2012 5:22 PM
1 of 7
http://thecodecracker.com/c-programming/queue-operations-using-link...
printf("\n 2.Deletion"); printf("\n 3.Display"); printf("\n 4.Exit"); printf("\n Enter your choice : "); scanf("%d",&ch); switch(ch) { case 1:
Graph
Hashing
insertion();
CATEGORIES C Programming (121) C++ (6) Data Structures Python (6) Shell Scripting (16) Sorting (2) System Programming (4) (5)
Implementation of Pointers
Infix Expression Evaluation
break; case 2: deletion(); break; case 3: display(); break; default: break; } }while(ch<=3); } void insertion() { int item; new=(N*)malloc(sizeof(N)); printf("\nEnter the item : "); scanf("%d",&item); new->info=item; new->link=NULL; if(front==NULL)
inheritance
Pointers
Pointer to Structure Prims
Algorithm
Python
Python GUI
Queue Shell
Operations Shell Sort
Sorting Stack
2 of 7
12/24/2012 5:22 PM
http://thecodecracker.com/c-programming/queue-operations-using-link...
front=new; else
PAGES Codes C Programs C++ Programs Python Programs Shell Scripts Contact us Blog
Tkinter Tree
CATEGORIES
else
C Programming (121) C++ (6) Data Structures Python (6) Shell Scripting (16) Sorting (2) System Programming (4) (5)
{ p=front; printf("\nDeleted element is : %d",p->info); front=front->link; free(p); } } void display() { if(front==NULL) printf("\nQueue is empty"); else { printf("\nThe elements are : "); temp=front; while(temp!=NULL) { printf("%d",temp->info); temp=temp->link; }
RECENT COMMENTS nalsaamu on implementation of stack using array deebalakshmi on C Program of Double Linked List theang on Program to find Mean,Median,and
3 of 7
12/24/2012 5:22 PM
http://thecodecracker.com/c-programming/queue-operations-using-link...
} }
PAGES Codes C Programs C++ Programs Python Programs Shell Scripts Contact us Blog Rating: 8.6/10 (57 votes cast) Rating: +22 (from 34 votes) CATEGORIES C Programming (121) C++ (6) Data Structures Python (6) Shell Scripting (16) Sorting (2) System Programming (4) (5)
Mode sysabod on Best method to find biggest of 3 numbers rajat on queue operations using linked list
Keys : linked list, queue, queue operations using linked list, queue using linked list, "c linked" list introduction, linked implimentation of stack in c language, program of implimentation of stack in linked lists in c language, singile linkedlists in c, single linkedlists in c, c linked list.
Related posts:
10. April 2008 by Jishnu Categories: C Programming | Tags: Linked List, Queue, queue using linked list | 9 comments
Comments (9)
Mistake in code in insertion function if front==NULL with front=p rear also assign to p; else wrong output means if(front==NULL)
4 of 7
12/24/2012 5:22 PM
http://thecodecracker.com/c-programming/queue-operations-using-link...
{ front=p; rear=p }
PAGES Codes C Programs C++ Programs Python Programs Shell Scripts Contact us Blog keivan says April 13, 2010 at 1:21 am Mahesh says April 7, 2010 at 2:21 pm
it is dealt with at the end already. See the program closely. Its correct.
CATEGORIES C Programming (121) C++ (6) Data Structures Python (6) Shell Scripting (16) Sorting (2) System Programming (4) (5)
I had a few errors running this program on my pc..heres the corrected code with a few corrections from my side.. #include #include #define MAXSIZE 10 void insertion(); void deletion(); void display(); typedef struct node { int info; node *link; }N; N *new1,*temp,*p,*front=NULL,*rear=NULL; void main() {
5 of 7
12/24/2012 5:22 PM
http://thecodecracker.com/c-programming/queue-operations-using-link...
PAGES Codes C Programs C++ Programs Python Programs Shell Scripts Contact us Blog
CATEGORIES C Programming (121) C++ (6) Data Structures Python (6) Shell Scripting (16) Sorting (2) System Programming (4) (5)
int ch; do { printf(\n Enter your choice : ); printf(1.Insertion 2.Deletion 3.Display 4.Exit); scanf(%d,&ch); switch(ch) { case 1:insertion();break; case 2:deletion();break; case 3:display();break; case 4: default:break; } }while(chinfo=item; new1->link=NULL; if(front==NULL) front=new1; else rear->link=new1; rear=new1; } void deletion() { if(front==NULL) printf(\nQueue is empty); else { p=front; printf(\nDeleted element is : %d,p->info); front=front->link; free(p); } } void display() { if(front==NULL) printf(\nQueue is empty); else { printf(\nThe elements are : ); temp=front; while(temp!=NULL) { printf(%d ,temp->info); temp=temp->link; } } }
6 of 7
12/24/2012 5:22 PM
http://thecodecracker.com/c-programming/queue-operations-using-link...
i am very thankful 2 u for this program. u r very good programmer this program is very easy to understand. thanks.
PAGES Codes C Programs C++ Programs Python Programs Shell Scripts Contact us Blog Dharmendra says December 21, 2011 at 11:15 pm
thanxx dude, very very THANK U, tomorrow my practical exams of Data Structures & Algo. (DSA), i get my problems solution here so ONCE MORE THANKSSSSSSSSS
rajat says September 8, 2012 at 12:53 am CATEGORIES C Programming (121) C++ (6) Data Structures Python (6) Shell Scripting (16) Sorting (2) System Programming (4) (5)
Leave a Reply
Previous Post
Next Post
2012 The Code Cracker. Modified Ari theme. Proudly powered by WordPress.
7 of 7
12/24/2012 5:22 PM