Showing posts with label QUEUE. Show all posts
Showing posts with label QUEUE. Show all posts

DIFFERENCE BETWEEN STACK AND QUEUE

 =>APPLICATIONS OF QUEUE:

1) simulation

2) time sharing system

3) CPU sheduling- round robin technique(RR)

4) Graph traversal technique(BFS)

5) Jobs sent to printer

6) ticket line, transection line.

=>QUE- What is the difference beyween STACK and QUEUE.
ANS-

=>SIMILARTIES:

1)BOTH ARE COLLECTION OF NODES.

2) BOTH ARE LINEAR DATA STRUCTURES.

INTRODUCTION TO QUEUE

DEFINATION:

QUEUE:- is a collection of node. Queue consist of two parts

a) FRONT- items are deleted from the front part of queue.
b) REAR- items are inserted from the rear part of queue.

*Order of insertion is same to that of order of deletion of data items of queue.

*it is based on FIFO( FIRST IN FIRST OUT )

*Eg-suppose we want to add items in queue say a b c d e etc. so order of insertion a b c d e. Order of deletion a b c d e etc.

*queue deals with manipulation and retrival of data items from the internal memory.

*QUEUE is a LINEAR DATA STRUCTURE.

REPRESENTATION OF QUEUE:
 2 METHODS

1) ARRAY REPRESENTATION OF QUEUE

2)DYNAMIC IMPLEMENTATION OF QUEUE

HOW TO INSERT AND DELETE IN QUEUE: