UNIVERSAL COLLEGE OF ENGG. AND TECH. 3 RD IT. QUEUE ( data structure)

Slides:



Advertisements
Similar presentations
Data Structures Through C
Advertisements

STACKS & QUEUES. Stacks Abstract data types An abstract data type (ADT) is an abstraction of a data structure An ADT specifies : –Data stored –Operations.
Stacks, Queues, and Linked Lists
Data Structures Lecture 13: QUEUES Azhar Maqsood NUST Institute of Information Technology (NIIT)
ADVANCED DATA STRUCTURES AND ALGORITHM ANALYSIS Chapter 3 Lists, Stacks, and Queues.
ADT Queue 1. What is a Queue? 2. STL Queue 3. Array Implementation of Queue 4. Linked List Implementation of Queue 5. Priority Queue.
Min Chen School of Computer Science and Engineering Seoul National University Data Structure: Chapter 4.
1 CSC 211 Data Structures Lecture 22 Dr. Iftikhar Azim Niaz 1.
 Abstract Data Type Abstract Data Type  What is the difference? What is the difference?  Stacks Stacks  Stack operations Stack operations  Parsing.
Queue RIZWAN REHMAN CENTRE FOR COMPUTER STUDIES DIBRUGARH UNIVERSITY.
CS Data Structures II Review COSC 2006 April 14, 2017
Chapter 7 Queues. © 2005 Pearson Addison-Wesley. All rights reserved7-2 The Abstract Data Type Queue A queue –New items enter at the back, or rear, of.
© 2006 Pearson Addison-Wesley. All rights reserved8-1 Chapter 8 Queues CS102 Sections 51 and 52 Marc Smith and Jim Ten Eyck Spring 2008.
Data Structures: Lists i206 Fall 2010 John Chuang Some slides adapted from Glenn Brookshear, Brian Hayes, or Marti Hearst.
CS 106 Introduction to Computer Science I 12 / 11 / 2006 Instructor: Michael Eckmann.
Chapter 7 Queues. © 2005 Pearson Addison-Wesley. All rights reserved7-2 The Abstract Data Type Queue A queue –New items enter at the back, or rear, of.
1 Stack Data : a collection of homogeneous elements arranged in a sequence. Only the first element may be accessed Main Operations: Push : insert an element.
CHAPTER 05 Compiled by: Dr. Mohammad Omar Alhawarat Stacks & Queues.
CHP-4 QUEUE.
© 2006 Pearson Addison-Wesley. All rights reserved8 A-1 Chapter 8 Queues (slightly modified by Dan Fleck)
© 2006 Pearson Education Chapter 12: Data Structures Presentation slides for Java Software Solutions for AP* Computer Science A 2nd Edition by John Lewis,
Queue 1 Operations on Queues A Dequeue Operation An Enqueue Operation Array Implementation Link list Implementation Examples.
1 Chapter 7 Stacks and Queues. 2 Stack ADT Recall that ADT is abstract data type, a set of data and a set of operations that act upon the data. In a stack,
Lists, Stacks and Queues in C Yang Zhengwei CSCI2100B Data Structures Tutorial 4.
Foundation of Computing Systems Lecture 3 Stacks and Queues.
Stacks And Queues Chapter 18.
Cousin of the Stack.  An abstract data type (container class) in which items are entered at one end and removed from the other end  First In First.
Queue Queue: –Like any other data structure (apart from Array and Linked List), Queue also can be implemented, –Either as an Array or, –As a Linked List.
The Abstract Data Type Queue A queue New items enter at the back, or rear, of the queue Items leave from the front of the queue First-in, first-out (FIFO)
1 Lecture 14: Queues Lecturer: Santokh Singh CompSci 105 SS 2005 Principles of Computer Science.
Data Structures Chapter 6. Data Structure A data structure is a representation of data and the operations allowed on that data. Examples: 1.Array 2.Record.
CHP-4 QUEUE. 1.INTRODUCTION  A queue is a linear list in which elements can be added at one end and elements can be removed only at other end.  That.
Computer Science Department Data Structures and Algorithms Queues Lecture 5.
Chapter 8 Queues. © 2004 Pearson Addison-Wesley. All rights reserved 8-2 The Abstract Data Type Queue A queue –New items enter at the back, or rear, of.
Data Structures – Week #4 Queues. January 12, 2016Borahan Tümer, Ph.D.2 Outline Queues Operations on Queues Array Implementation of Queues Linked List.
© 2011 Pearson Addison-Wesley. All rights reserved 8 B-1 Chapter 8 (continued) Queues.
Stack and Queues Part 2. Priority Queues Priority Queues (cont’) A priority queue is a more specialized data structure than a stack or a queue. However,
Give Eg:? Queues. Introduction DEFINITION: A Queue is an ordered collection of element in which insertions are made at one end and deletions are made.
Introduction Of Queue. Introduction A queue is a non-primitive linear data structure. It is an homogeneous collection of elements in which new elements.
Computer Engineering Rabie A. Ramadan Lecture 6.
Spring 2008 Mark Fontenot CSE Honors Principles of Computer Science I Note Set 15 1.
Lecture 10 b Stacks b Queues. 2 Stacks b A stack ADT is linear b Items are added and removed from only one end of a stack b It is therefore LIFO: Last-In,
1 Data Structures CSCI 132, Spring 2014 Lecture 7 Queues.
Queue ADT for lining up politely. COSC 2006 queue2 Queue – simple collection class  first-in first-out (FIFO) structure insert new elements at one end.
 In general, Queue is line of person waiting for their turn at some service counter like ticket window at cinema hall, at bus stand or at railway station.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley. Ver Chapter 7: Queues Data Abstraction & Problem Solving with C++
Queues Chapter 8 (continued)
Review Array Array Elements Accessing array elements
Data Abstraction & Problem Solving with C++
Queues Chapter 4.
Set Collection A Bag is a general collection class that implements the Collection interface. A Set is a collection that resembles a Bag with the provision.
CC 215 Data Structures Queue ADT
Program based on queue & their operations for an application
Chapter 15 Lists Objectives
Algorithm and Data Structure Part II Dr. Naimah Yaakob
Stacks and Queues.
Queues Queues Queues.
Stack and Queue APURBO DATTA.
Queues Chapter 4.
Queues.
DATA STRUCTURE QUEUE.
Queues 11/22/2018 6:47 AM 5.2 Queues Queues Dr Zeinab Eid.
Cs212: Data Structures Computer Science Department Lecture 7: Queues.
Stack A data structure in which elements are inserted and removed only at one end (called the top). Enforces Last-In-First-Out (LIFO) Uses of Stacks Evaluating.
Chapter 8 Queues © 2006 Pearson Addison-Wesley. All rights reserved.
Copyright © Aiman Hanna All rights reserved
QUEUE Visit for more Learning Resources Free Powerpoint Templates.
17CS1102 DATA STRUCTURES © 2016 KL University – The contents of this presentation are an intellectual and copyrighted property of KL University. ALL RIGHTS.
Queues cont. Chapter 8 © 2011 Pearson Addison-Wesley. All rights reserved.
Queues.
Presentation transcript:

UNIVERSAL COLLEGE OF ENGG. AND TECH. 3 RD IT

QUEUE ( data structure)

Queue  It is a linear data structure used to represent a linear list and permits deletion to be performed at one end and of the list and the insertions at the other end.  The information in such a list is processed in the same order as it was received.  i.e-FIRST-COME-FIRST-SERVE basis(FCFS).  Or FIRST IN FIRST OUT(FIFO).

Implementation of queue.  Two common ways in which queues may be implemented are as follows:  ARRAYS  POINTERS(one way linear linked list)

Different type of queue  Circular queue  Double Ended Queue  Priority queue

Operations of queue  Insertion in queue.  Deletion in queue.  List(display) of the queue.

Circular queue  Let we have an array named Q, that contains n element in which Q[1] comes after Q[n] in the array.  When this technique is used to construct a queue is called circular queue.  In other word we can say that a queue is called circular when the last room comes just before the first room.

Circular queue…. Q[1] Q[2] Q[3]... Q[n-1] Q[n]

Queue cont….  In a circular queue when rear=n, if we insert an element then this element is assigned to q[1] instead of increasing rear to n+1.  Suppose queue contains only one element that is front=rear!=0 and suppose that the element is removed then the front and rear pointers are now assigned ‘0’ to indicate that the queue is EMPTY.

Priority Queue A Special form of queue from which items are removed according to their designated priority and not the order in which they entered. OR It is a container in which chances or deletion is of the highest priority item according to the same of asssigning priorities to items

A Pointer-Based Implementation

Differenence between stack n queue  Stacks and queues are very similar  Operations of stacks and queues can be paired off as createStack and createQueue Stack isEmpty and queue isEmpty push and enqueue pop and dequeue Stack getTop and queue getFront

Application of queue  An e.g. of queue is time sharing computer system where many users share the system simultaneously.  The procedure, which is used to design such type of system, is Round Robin Technique.  The railway reservation counter is also an example of queue where the people collect their tickets on FIFO or FCFS based.

Presented by :  Drashti jadav  Zeel jani  Jay gupta

THANK YOU