SlideShare ist ein Scribd-Unternehmen logo
1 von 20
Created By   Zaheer Abbas Aghani   2k9-152
Lecture 17-18
Queue (definition) ,[object Object],[object Object],[object Object]
[object Object],Queues in Our Life
Queue examples Cont….: ,[object Object],PRINTER QUEUE PC-4 PC-1 PC-3 PC-5 PC-2 FRONT REAR
Basic operations of queue. ,[object Object],[object Object],[object Object],[object Object],[object Object]
QUEUE OPERATIONS
Queue operation continue… ,[object Object],[object Object],Enqueue B A C D B A C D FRONT REAR FRONT REAR 1 2 3 1 2 3 4
Queue operation continue… ,[object Object],[object Object],Dequeue A 1 B A C B C FRONT REAR FRONT REAR 1 2 3 2 3
Queue operation continue… ,[object Object],[object Object],FRONT A A 1 B A C B C FRONT REAR FRONT REAR 1 2 3 2 3
Queue operation continue… ,[object Object],[object Object],END C A 1 B A C B C FRONT REAR FRONT REAR 1 2 3 2 3
Conditions of Queue: ,[object Object],[object Object]
Implementation of queue in array or linked list: ,[object Object],[object Object],[object Object],[object Object]
Algorithm (Add Operation) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],A MAXQUE MAXQUE B 1 2 3 4 FRONT REAR A B C 1 2 3 4 FRONT REAR
Algorithm (Delete Operation) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],MAXQUE MAXQUE 5 4 5 A B C 1 2 3 4 FRONT REAR B C 1 2 3 FRONT REAR
TYPES of queue: ,[object Object]
TYPES of queue cont…: ,[object Object],[object Object],[object Object],[object Object],[object Object]
Operations example: ,[object Object],[object Object],[object Object],[object Object]
Step1: Enqueue A   Step2: Enqueue B   Step3:Queue-front Step:1 Enqueue A 1 2 3 4 1 2 3 4 FRONT=0 FRONT REAR REAR=0 A A Enqueue B 1 2 3 4 1 2 3 4 FRONT FRONT REAR REAR B A B Step:2 A FRONT 1 2 3 4 1 2 3 4 FRONT FRONT REAR REAR A A B Step:3 A B
Step4: Dequeue Step5: Enqueue C   Step6: Queue-Last Dequeue 1 2 3 4 1 2 3 4 FRONT FRONT REAR REAR A B Step:4 A B Enqueue C 1 2 3 4 1 2 3 4 FRONT FRONT REAR REAR C B Step:5 B C LAST 1 2 3 4 1 2 3 4 FRONT FRONT REAR REAR C B Step:6 B C C

Weitere ähnliche Inhalte

Was ist angesagt?

Stacks Implementation and Examples
Stacks Implementation and ExamplesStacks Implementation and Examples
Stacks Implementation and Examples
greatqadirgee4u
 
Deque and its applications
Deque and its applicationsDeque and its applications
Deque and its applications
Jsaddam Hussain
 

Was ist angesagt? (20)

Queue-Data Structure
Queue-Data StructureQueue-Data Structure
Queue-Data Structure
 
Stack
StackStack
Stack
 
Stack Data Structure
Stack Data StructureStack Data Structure
Stack Data Structure
 
Stacks
StacksStacks
Stacks
 
Stack
StackStack
Stack
 
Application of Stack - Yadraj Meena
Application of Stack - Yadraj MeenaApplication of Stack - Yadraj Meena
Application of Stack - Yadraj Meena
 
Team 6
Team 6Team 6
Team 6
 
STACKS IN DATASTRUCTURE
STACKS IN DATASTRUCTURESTACKS IN DATASTRUCTURE
STACKS IN DATASTRUCTURE
 
Stack and queue
Stack and queueStack and queue
Stack and queue
 
Stack and its Applications : Data Structures ADT
Stack and its Applications : Data Structures ADTStack and its Applications : Data Structures ADT
Stack and its Applications : Data Structures ADT
 
Queue
QueueQueue
Queue
 
STACK ( LIFO STRUCTURE) - Data Structure
STACK ( LIFO STRUCTURE) - Data StructureSTACK ( LIFO STRUCTURE) - Data Structure
STACK ( LIFO STRUCTURE) - Data Structure
 
Stack
StackStack
Stack
 
Stack application
Stack applicationStack application
Stack application
 
Stacks
StacksStacks
Stacks
 
Queue in Data Structure
Queue in Data Structure Queue in Data Structure
Queue in Data Structure
 
D422 ex-4-2 python
D422 ex-4-2 pythonD422 ex-4-2 python
D422 ex-4-2 python
 
Stacks Implementation and Examples
Stacks Implementation and ExamplesStacks Implementation and Examples
Stacks Implementation and Examples
 
Deque and its applications
Deque and its applicationsDeque and its applications
Deque and its applications
 
Stacks in c++
Stacks in c++Stacks in c++
Stacks in c++
 

Ähnlich wie Lect 17-18 Zaheer Abbas

queuesArrays.ppt bbbbbbbbbbbbbbbbbbbbbbbbbb
queuesArrays.ppt bbbbbbbbbbbbbbbbbbbbbbbbbbqueuesArrays.ppt bbbbbbbbbbbbbbbbbbbbbbbbbb
queuesArrays.ppt bbbbbbbbbbbbbbbbbbbbbbbbbb
RAtna29
 

Ähnlich wie Lect 17-18 Zaheer Abbas (20)

Data Structures by Maneesh Boddu
Data Structures by Maneesh BodduData Structures by Maneesh Boddu
Data Structures by Maneesh Boddu
 
Stack.pptx
Stack.pptxStack.pptx
Stack.pptx
 
Queue Data Structure
Queue Data StructureQueue Data Structure
Queue Data Structure
 
Queue
QueueQueue
Queue
 
queues.pptx
queues.pptxqueues.pptx
queues.pptx
 
@Chapter 4 DSA Part II.pptx
@Chapter 4 DSA Part II.pptx@Chapter 4 DSA Part II.pptx
@Chapter 4 DSA Part II.pptx
 
Queue
QueueQueue
Queue
 
Bca ii dfs u-2 linklist,stack,queue
Bca ii  dfs u-2 linklist,stack,queueBca ii  dfs u-2 linklist,stack,queue
Bca ii dfs u-2 linklist,stack,queue
 
Queues presentation
Queues presentationQueues presentation
Queues presentation
 
basics of queues
basics of queuesbasics of queues
basics of queues
 
Bsc cs ii dfs u-2 linklist,stack,queue
Bsc cs ii  dfs u-2 linklist,stack,queueBsc cs ii  dfs u-2 linklist,stack,queue
Bsc cs ii dfs u-2 linklist,stack,queue
 
Mca ii dfs u-3 linklist,stack,queue
Mca ii dfs u-3 linklist,stack,queueMca ii dfs u-3 linklist,stack,queue
Mca ii dfs u-3 linklist,stack,queue
 
Data structure.ppt
Data structure.pptData structure.ppt
Data structure.ppt
 
Queue
QueueQueue
Queue
 
queue & its applications
queue & its applicationsqueue & its applications
queue & its applications
 
queuesArrays.ppt bbbbbbbbbbbbbbbbbbbbbbbbbb
queuesArrays.ppt bbbbbbbbbbbbbbbbbbbbbbbbbbqueuesArrays.ppt bbbbbbbbbbbbbbbbbbbbbbbbbb
queuesArrays.ppt bbbbbbbbbbbbbbbbbbbbbbbbbb
 
Queue
QueueQueue
Queue
 
Queue
QueueQueue
Queue
 
Queue data structures and operation on data structures
Queue data structures and operation on data structuresQueue data structures and operation on data structures
Queue data structures and operation on data structures
 
queue_final.pptx
queue_final.pptxqueue_final.pptx
queue_final.pptx
 

Mehr von Information Technology Center (16)

It3 4 by Zaheer Abbas Aghani
It3 4 by Zaheer Abbas AghaniIt3 4 by Zaheer Abbas Aghani
It3 4 by Zaheer Abbas Aghani
 
Flip & flop by Zaheer Abbas Aghani
Flip & flop by Zaheer Abbas AghaniFlip & flop by Zaheer Abbas Aghani
Flip & flop by Zaheer Abbas Aghani
 
C# by Zaheer Abbas Aghani
C# by Zaheer Abbas AghaniC# by Zaheer Abbas Aghani
C# by Zaheer Abbas Aghani
 
C# by Zaheer Abbas Aghani
C# by Zaheer Abbas AghaniC# by Zaheer Abbas Aghani
C# by Zaheer Abbas Aghani
 
Lect 22 Zaheer Abbas
Lect 22 Zaheer AbbasLect 22 Zaheer Abbas
Lect 22 Zaheer Abbas
 
Lect 21 Zaheer Abbas
Lect 21 Zaheer AbbasLect 21 Zaheer Abbas
Lect 21 Zaheer Abbas
 
Lect 19 Zaheer Abbas
Lect 19 Zaheer AbbasLect 19 Zaheer Abbas
Lect 19 Zaheer Abbas
 
Lect 14 Zaheer Abbas
Lect 14 Zaheer AbbasLect 14 Zaheer Abbas
Lect 14 Zaheer Abbas
 
Lect 13 Zaheer Abbas
Lect 13 Zaheer AbbasLect 13 Zaheer Abbas
Lect 13 Zaheer Abbas
 
Lect 11-12 Zaheer Abbas
Lect 11-12 Zaheer AbbasLect 11-12 Zaheer Abbas
Lect 11-12 Zaheer Abbas
 
Lect 10 Zaheer Abbas
Lect 10 Zaheer AbbasLect 10 Zaheer Abbas
Lect 10 Zaheer Abbas
 
Lect 15-16 Zaheer Abbas
Lect 15-16 Zaheer  AbbasLect 15-16 Zaheer  Abbas
Lect 15-16 Zaheer Abbas
 
Lect 9(pointers) Zaheer Abbas
Lect 9(pointers) Zaheer AbbasLect 9(pointers) Zaheer Abbas
Lect 9(pointers) Zaheer Abbas
 
Lect 8(pointers) Zaheer Abbas
Lect 8(pointers) Zaheer AbbasLect 8(pointers) Zaheer Abbas
Lect 8(pointers) Zaheer Abbas
 
Lect 3-4 Zaheer Abbas
Lect 3-4 Zaheer AbbasLect 3-4 Zaheer Abbas
Lect 3-4 Zaheer Abbas
 
Lect 1-2 Zaheer Abbas
Lect 1-2 Zaheer AbbasLect 1-2 Zaheer Abbas
Lect 1-2 Zaheer Abbas
 

Kürzlich hochgeladen

EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
Earley Information Science
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
giselly40
 

Kürzlich hochgeladen (20)

What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 

Lect 17-18 Zaheer Abbas

  • 1. Created By Zaheer Abbas Aghani 2k9-152
  • 3.
  • 4.
  • 5.
  • 6.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19. Step1: Enqueue A Step2: Enqueue B Step3:Queue-front Step:1 Enqueue A 1 2 3 4 1 2 3 4 FRONT=0 FRONT REAR REAR=0 A A Enqueue B 1 2 3 4 1 2 3 4 FRONT FRONT REAR REAR B A B Step:2 A FRONT 1 2 3 4 1 2 3 4 FRONT FRONT REAR REAR A A B Step:3 A B
  • 20. Step4: Dequeue Step5: Enqueue C Step6: Queue-Last Dequeue 1 2 3 4 1 2 3 4 FRONT FRONT REAR REAR A B Step:4 A B Enqueue C 1 2 3 4 1 2 3 4 FRONT FRONT REAR REAR C B Step:5 B C LAST 1 2 3 4 1 2 3 4 FRONT FRONT REAR REAR C B Step:6 B C C