Skip to main content

QUEUE


QUEUE
 //QUEUE
#include<stdio.h>
#include<conio.h>
#include<alloc.h>
typedef struct stk
{
int info;
struct stk *link;
}node;
node *start;
void create()
{
printf("\n'Create' Function Called\n");
start=NULL;
}
void enqueue()
{

node *ptr;
int i;
ptr=(node*)malloc(sizeof(node));
printf("\nEnqueue Value: ");
scanf("%d",&i);
ptr->info=i;
ptr->link=start;
start=ptr;
}

void display()                         //DISPLAY
{
node *ptr;
printf("\n\n'Display' Function Called");
ptr=start;
if(start==NULL)
{
printf("\n*Queue Empty 'Underflow'*");
}else
{
while(ptr->link!=NULL)
{
printf("\nInfo= %d",ptr->info);
ptr=ptr->link;
}
printf("\nInfo= %d",ptr->info);
}
printf("\n");
getch();
}
void dequeue()
{
int p;
node *ptr,*ptr1;
printf("\n'Dequeue' Function Called");
ptr=start;
if(start==NULL)
{
printf("\n*Queue Empty 'Underflow'*");
}else
{
if(ptr->link==NULL)
{
start=NULL;
}
while(ptr->link!=NULL)
{
ptr1=ptr;
ptr=ptr->link;
}
ptr1->link=NULL;
}
display();
}
void main()
{
clrscr();
create();
enqueue();
enqueue();
enqueue();
enqueue();
display();
dequeue();
dequeue();
dequeue();
dequeue();
printf("\t\t**END**");
getch();
}

***********************************************************************************

Sample Output:








Comments

Popular posts from this blog

DATA STRUCTURE SYLLABUS

Data Structures  
SECTION-A 
1. Basic Concepts and Notations, Introduction to Complexity, Data Structure and Data Structure operations. Applications of Data Structure. Basic data Structures: Arrays: Introduction, Types of Array, Memory representation, Applications and operations. Stacks and queue: Introduction, memory representation, Applications and operations 
(No. of Periods : 15) 
SECTION-B 
 2. Linked List: Operations:-traversing, searching, inserting, deleting, operations on header linked list, circular linked list, doubly linked list, memory representation, Applications, polynomial manipulation. 
( No. of Periods : 15) 
SECTION-C 

3. Trees – Definition and Basic concepts, Representation in Contiguous Storage, Binary Tree, Binary Tree Traversal, Searching, Insertion and deletion in Binary trees, Binary Search tree, AVL trees.
 (No. of Periods : 15)
 SECTION-D
4. Searching: Binary and Linear Search. Sorting: Bubble sort, Insertion sort, Selection sort, Merge Sort, Radix sort, Quick sort, S…

COMPUTER BASED NUMERICAL & METHOD(CONM) Syllabus

SyllabusBCA-2nd Year: SECTION-A 
 1. Computer Arithmetic :Floating Point Numbers, operations, normalizations and    their consequences, Errors and its types. 
 2. Iterative Methods :Bisection, False-Position, Newton - Raphson Methods,  Zeros of a polynomial using Birge – Vieta Method. 

(No. of Periods : 15)
SECTION B
3.Simultaneous Linear Equations : Solution of Simultaneous Linear Equations Using Gauss - Elimination, Gauss-Jordan and Gauss-Seidal Methods, Concept of Pivoting.  
4.Interpolation:  Lagrange,  Newton  forward,  Newton  Backward,  Divided  Difference, Newton forward difference, Newton Backward difference, Numerical  Integration: Trapezoidal, Simpson’s 1/3, Simpson’s 3/8, Weddle and Runga–    Kutta Methods: 2nd order & 4th order.

      (No. of Periods : 15) 

SECTION-C
5. Measures of Central Tendency:Peparing Frequency distribution table, Arithmetic mean, Geometric mean, Harmonic mean, Median and Mode.        6. Measures  of  Dispersion,  Skewness and Kurtosis,  Range :Mean   d…

ENVIRONMENT AND ROAD SAFETY EDUCATION

SEMESTER – IINote: 

The syllabus has 15 topics to be covered in 25-hour lectures in total, with 2 lectures in each topic from 2 to 11 and one each for the topics 1 and 12 to 15.

1. Environment Concept: Introduction, the concept of biosphere – lithosphere, hydrosphere, atmosphere; Natural resources – their need and types; Principles and scope of Ecology; concepts of the ecosystem, population, community, biotic interactions, biomes, ecological succession.

2. Atmosphere: Parts of atmosphere, components of air; pollution, pollutants, their sources, permissible limits, risks and possible control measures.

3. Hydrosphere: Types of aquatic systems; Major sources (including ground water) and uses of water, problems of the hydrosphere, fresh water shortage; pollution and pollutants of water, permissible limits, risks and possible control measures.

4. Lithosphere: Earth crust, soil – a life support system, its texture, types, components, pollution and pollutants, reasons of soil erosion and poss…