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

COMPUTER ORGANISATION

6TH SEMESTER: SECTION-A 
1. Computer Organisation : Evolution of Computers, Stored program concept and Von Neumann Architecture, Information representation and codes, Combinatorial Blocks : Gates, Multiplexers, Decoders, Encoders, Sequential Building blocks : Flip-Flops, Registers, Counters, Arithmetic algorithms : Addition and subtraction for signed magnitude and 2's complement numbers, integer multiplication using shift and add, Booth's algorithms, Integer and floating point representation.

SECTION-B
 2. Architecture of a Simple Processor : An instruction set, Addressing Modes, Instruction formats, Instruction execution in terms of Microinstructions, Concept of interrupt and simple I/O organisation, I/O organization : Strobe-based and Handshake based communication, Vector and priority interrupts, DMA-based data transfer; CPU organisation with large registers, Stacks and handling of interrupts and subroutines. Concept of Bus, data movement among registers, data movement from/to…

ENTREPRENEURSHIP DEVELOPMENT PROGRAMME SYLLABUS

ENTREPRENEURSHIP DEVELOPMENT PROGRAMME
SECTION-A 
1.Project Formulation :

Need, Scope and approaches for project formulation; the structure of project report; study and analysis of sample project report; preparation of a project report; Techno- economic feasibility of the project. (No. of Periods : 25)

SECTION-B
2. Finance & Accounting :

Working capital assessment, its management & exercise thereon; Assessment of fixed capital and exercise thereon; Capital budgeting; Product costing and cost consciousness. Financial ratios and their significance; Break-even analysis; Credit institutions and financing procedures; Books of accounts, financial statements & fund flow analysis.

SECTION-C
3. Managing the Enterprise:

Resource management – men, material, money, and machines; Personnel management, Office management. E-Commerce: Introduction to E-Commerce, Benefits, Impact of E-Commerce, Classification of E-Commerce, Application of E-Commerce.

SECTION - D
4. Rules & Regulations:

Lic…

PRINCIPLES OF COMPUTER GRAPHICS & MULTIMEDIA TECHNOLOGY SYLLABUS

Computer Graphics
SECTION-A 
1. A Survey of Computer Graphics :

Computer Aided Design, Presentation Graphics, Computer art, Entertainment, Education and Training, Visualization, Image Pressing, Graphical User Interfaces.

2. Overview of Graphics Systems :

Video Display Devices, Raster Scan Systems, Random Scan Systems. Coloring technique : Beam Penetration, Shadow Mask. Graphics Monitors:Plasma Panel, LED,LCD. Properties of Display Devices : Persistence , Resolution, Aspect Ratio. and Workstations, Input Devices, Hard-copy devices, Graphics Software. Interactive Graphics, Passive Graphics.


SECTION-B
 3. Studying the Features and Developing Computer Graphics Using Standard Graphics packages like Auto CAD and Photoscape.

AutoCAD:

Features, Workspace, Commands to draw line, Polyline, rectangle, polygon, circle, spline, hatch; Modification Commands: Erase, copy, move, mirror, scale, Pan, Zoom, ESC, cl, trim; Layer, Dimension, image rotation, area calculation.

4. Developing Computer Graphics…