SlideShare una empresa de Scribd logo
1 de 25
Queue Data Structure
What is queue? ,[object Object],[object Object],[object Object]
Queue operations ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Illustration/example ,[object Object],Queue’s contents Return value 1. Initialiaze(S) <empty> - 2. Add(A,Q) A - 3. Add(B,Q) A  B  - 4. Add(C,Q) A  B  C - 5. Remove(Q) B  C A 6. Add(D,Q) B  C  D - 7. Remove(Q) C  D B 8. Remove(Q) D C 9. Remove(Q) <empty> D
Exercise: Queue Operation ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Storing a queue in a static data structure ,[object Object],[object Object],[object Object],[object Object]
Storing a queue in a static data structure (2) Continue the above example to show the state of the queue after the following operations: Add(E,Q) Remove(Q) Add(W,Q) Add(J,Q) Add(K,Q) What happens at the last of these steps?
Storing a queue in a dynamic data structure ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Adding a node (Add) in a dynamic data structure ,[object Object]
Removing a node (Remove) in a dynamic data structure ,[object Object],[object Object],[object Object]
Queue Implementation
Queue Implementation in Java ,[object Object],[object Object],[object Object]
The Queue Class ,[object Object],[object Object],[object Object],[object Object]
The Queue Class (2) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],/* Constructor for objects of class Queue */ public Queue() { // initialise head and tail references head = null; tail = null; } /* sets all queue entries to null */ public void destroy() { Node temp = new Node(); Node setNull = new Node(); temp = head; while (temp!=null) { setNull = temp; temp = temp.nextNode; setNull = null; } head = null; tail = null; }
The Queue Class (3) ,[object Object],[object Object],[object Object],[object Object],[object Object],/* add an item to the queue */ public void add(Object o) { Node newNode = new Node(); newNode.dataItem = o; if (tail == null) { head = newNode; tail = newNode; } else { tail.nextNode = newNode; tail = newNode; } } /* checks whether queue is full –  not properly implemented here */ public boolean isFull() { return false; } /* remove an item by obeying FIFO rule */ public Object remove() { if (head == null) return null; else { Node temp = new Node(); temp = head; head = head.nextNode; if (head == null) tail = null; return temp.dataItem; } }
The Queue Class (4) /* returns the number of items in the queue */ public int size() { int count = 0; for (Node current=head;current!=null; current=current.nextNode) count++; return count; }
Using a Queue ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],void addString(String str) void removeString() void checkIfEmpty() void listStringsInQueue()
Using a Queue (2) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],/* check if queue is empty */ public void checkIfEmpty() { if (queue.isEmpty()) System.out.println(&quot;Queue empty&quot;); else System.out.println(&quot;Queue is not empty&quot;); } /* list the strings in queue */ public void listStringsInQueue() { if (queue.isEmpty()) { System.out.println(&quot;Queue empty&quot;); } else { System.out.println(&quot;Strings in queue are: &quot;); System.out.println(); Node node = queue.head; while (node != null){ String item = (String)node.dataItem; System.out.println(item); node = node.nextNode; } System.out.println(); } }
Exercise: Using a Queue ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
For Your EXERCISE:  Storing other types of data ,[object Object],[object Object]
EXERCISE: A practical application of the Queue class ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
EXERCISE: A practical application (the code) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
EXERCISE: A practical application (the code) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
EXERCISE: A practical application (the code) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
EXERCISE: A practical application of the Queue class (test sequence) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]

Más contenido relacionado

La actualidad más candente

My lectures circular queue
My lectures circular queueMy lectures circular queue
My lectures circular queue
Senthil Kumar
 

La actualidad más candente (19)

Data Structures - Lecture 9 [Stack & Queue using Linked List]
 Data Structures - Lecture 9 [Stack & Queue using Linked List] Data Structures - Lecture 9 [Stack & Queue using Linked List]
Data Structures - Lecture 9 [Stack & Queue using Linked List]
 
Presentation on Elementary data structures
Presentation on Elementary data structuresPresentation on Elementary data structures
Presentation on Elementary data structures
 
stacks and queues
stacks and queuesstacks and queues
stacks and queues
 
Data structure stack&queue basics
Data structure stack&queue   basicsData structure stack&queue   basics
Data structure stack&queue basics
 
Data Structure -List Stack Queue
Data Structure -List Stack QueueData Structure -List Stack Queue
Data Structure -List Stack Queue
 
Data Structure (Queue)
Data Structure (Queue)Data Structure (Queue)
Data Structure (Queue)
 
Queue as data_structure
Queue as data_structureQueue as data_structure
Queue as data_structure
 
Stack & queue
Stack & queueStack & queue
Stack & queue
 
Queue Data Structure (w/ php egs)
Queue Data Structure (w/ php egs)Queue Data Structure (w/ php egs)
Queue Data Structure (w/ php egs)
 
Stacks in c++
Stacks in c++Stacks in c++
Stacks in c++
 
Queue data structure
Queue data structureQueue data structure
Queue data structure
 
My lectures circular queue
My lectures circular queueMy lectures circular queue
My lectures circular queue
 
My lecture stack_queue_operation
My lecture stack_queue_operationMy lecture stack_queue_operation
My lecture stack_queue_operation
 
Queue
QueueQueue
Queue
 
Queue AS an ADT (Abstract Data Type)
Queue AS an ADT (Abstract Data Type)Queue AS an ADT (Abstract Data Type)
Queue AS an ADT (Abstract Data Type)
 
Queue ppt
Queue pptQueue ppt
Queue ppt
 
The Stack And Recursion
The Stack And RecursionThe Stack And Recursion
The Stack And Recursion
 
stack presentation
stack presentationstack presentation
stack presentation
 
2.1 STACK & QUEUE ADTS
2.1 STACK & QUEUE ADTS2.1 STACK & QUEUE ADTS
2.1 STACK & QUEUE ADTS
 

Destacado

Updated-Resume-2015
Updated-Resume-2015Updated-Resume-2015
Updated-Resume-2015
Jiliang Wang
 
40 principales
40 principales40 principales
40 principales
sanxe7
 
Lucas french haap-skin
Lucas french haap-skinLucas french haap-skin
Lucas french haap-skin
mchibuzor
 
Presentacion aerosmith
Presentacion aerosmithPresentacion aerosmith
Presentacion aerosmith
Aerosmiith
 
Ideologias e ciência social - Michael Löwy
Ideologias e ciência social - Michael LöwyIdeologias e ciência social - Michael Löwy
Ideologias e ciência social - Michael Löwy
Fábio Wilke
 

Destacado (20)

Array operations
Array operationsArray operations
Array operations
 
القوائم المترابطة Linked List باستخدام لغة جافا
القوائم المترابطة Linked List باستخدام لغة جافاالقوائم المترابطة Linked List باستخدام لغة جافا
القوائم المترابطة Linked List باستخدام لغة جافا
 
Nuevas tecnologías, turismo y ciudad unidas a través de la geolocalización
Nuevas tecnologías, turismo y ciudad unidas a través de la geolocalizaciónNuevas tecnologías, turismo y ciudad unidas a través de la geolocalización
Nuevas tecnologías, turismo y ciudad unidas a través de la geolocalización
 
Updated-Resume-2015
Updated-Resume-2015Updated-Resume-2015
Updated-Resume-2015
 
Presentación enfermedades mitocondriales y función renal
Presentación enfermedades mitocondriales y función renalPresentación enfermedades mitocondriales y función renal
Presentación enfermedades mitocondriales y función renal
 
Communication theory 1
Communication theory 1Communication theory 1
Communication theory 1
 
Artemijas revista 2010
Artemijas revista 2010Artemijas revista 2010
Artemijas revista 2010
 
Kolekcje 2015
Kolekcje 2015Kolekcje 2015
Kolekcje 2015
 
40 principales
40 principales40 principales
40 principales
 
Lucas french haap-skin
Lucas french haap-skinLucas french haap-skin
Lucas french haap-skin
 
Revista Fungi Austral.
Revista Fungi Austral.Revista Fungi Austral.
Revista Fungi Austral.
 
Módní ikony pro fashion ecommerce: Shoproku
Módní ikony pro fashion ecommerce: ShoprokuMódní ikony pro fashion ecommerce: Shoproku
Módní ikony pro fashion ecommerce: Shoproku
 
pH.ORP Transmitter-Analog sensors-Digital sensors
pH.ORP Transmitter-Analog sensors-Digital sensorspH.ORP Transmitter-Analog sensors-Digital sensors
pH.ORP Transmitter-Analog sensors-Digital sensors
 
SEKENDIZ-An evaluation of emergency plans and procedures in fitness facilitie...
SEKENDIZ-An evaluation of emergency plans and procedures in fitness facilitie...SEKENDIZ-An evaluation of emergency plans and procedures in fitness facilitie...
SEKENDIZ-An evaluation of emergency plans and procedures in fitness facilitie...
 
Instrumentos tradicionales
Instrumentos tradicionalesInstrumentos tradicionales
Instrumentos tradicionales
 
Presentacion aerosmith
Presentacion aerosmithPresentacion aerosmith
Presentacion aerosmith
 
Tampico de mis recuerdos
Tampico de mis recuerdosTampico de mis recuerdos
Tampico de mis recuerdos
 
Ideologias e ciência social - Michael Löwy
Ideologias e ciência social - Michael LöwyIdeologias e ciência social - Michael Löwy
Ideologias e ciência social - Michael Löwy
 
End-of-Study project - Phase 1 - Maëlle Cabio'ch
End-of-Study project - Phase 1 - Maëlle Cabio'chEnd-of-Study project - Phase 1 - Maëlle Cabio'ch
End-of-Study project - Phase 1 - Maëlle Cabio'ch
 
Articulo ejercicio y embarazo
Articulo ejercicio y embarazoArticulo ejercicio y embarazo
Articulo ejercicio y embarazo
 

Similar a Queue Data Structure

queuesArrays.ppt bbbbbbbbbbbbbbbbbbbbbbbbbb
queuesArrays.ppt bbbbbbbbbbbbbbbbbbbbbbbbbbqueuesArrays.ppt bbbbbbbbbbbbbbbbbbbbbbbbbb
queuesArrays.ppt bbbbbbbbbbbbbbbbbbbbbbbbbb
RAtna29
 
Mcq 15-20Q15Which of the following trees are binary search tr
Mcq 15-20Q15Which of the following trees are binary search trMcq 15-20Q15Which of the following trees are binary search tr
Mcq 15-20Q15Which of the following trees are binary search tr
AbramMartino96
 
Data structures and algorithms lab4
Data structures and algorithms lab4Data structures and algorithms lab4
Data structures and algorithms lab4
Bianca Teşilă
 
Given the following ADT definition of a stack to use stack .docx
Given the following ADT definition of a stack to use stack .docxGiven the following ADT definition of a stack to use stack .docx
Given the following ADT definition of a stack to use stack .docx
shericehewat
 
Getting StartedCreate a class called Lab8. Use the same setup for .pdf
Getting StartedCreate a class called Lab8. Use the same setup for .pdfGetting StartedCreate a class called Lab8. Use the same setup for .pdf
Getting StartedCreate a class called Lab8. Use the same setup for .pdf
info309708
 
Sorted number list implementation with linked listsStep 1 Inspec.pdf
 Sorted number list implementation with linked listsStep 1 Inspec.pdf Sorted number list implementation with linked listsStep 1 Inspec.pdf
Sorted number list implementation with linked listsStep 1 Inspec.pdf
almaniaeyewear
 
In Class AssignmetzCST280W13a-1.pdfCST 280 In-Class Pract.docx
In Class AssignmetzCST280W13a-1.pdfCST 280 In-Class Pract.docxIn Class AssignmetzCST280W13a-1.pdfCST 280 In-Class Pract.docx
In Class AssignmetzCST280W13a-1.pdfCST 280 In-Class Pract.docx
bradburgess22840
 
Stack linked list
Stack linked listStack linked list
Stack linked list
bhargav0077
 
Using NetBeansImplement a queue named QueueLL using a Linked List .pdf
Using NetBeansImplement a queue named QueueLL using a Linked List .pdfUsing NetBeansImplement a queue named QueueLL using a Linked List .pdf
Using NetBeansImplement a queue named QueueLL using a Linked List .pdf
siennatimbok52331
 

Similar a Queue Data Structure (20)

LectureNotes-06-DSA
LectureNotes-06-DSALectureNotes-06-DSA
LectureNotes-06-DSA
 
queuesArrays.ppt bbbbbbbbbbbbbbbbbbbbbbbbbb
queuesArrays.ppt bbbbbbbbbbbbbbbbbbbbbbbbbbqueuesArrays.ppt bbbbbbbbbbbbbbbbbbbbbbbbbb
queuesArrays.ppt bbbbbbbbbbbbbbbbbbbbbbbbbb
 
Lec2
Lec2Lec2
Lec2
 
Tutorial 6 queues & arrays & results recording
Tutorial 6   queues & arrays & results recording Tutorial 6   queues & arrays & results recording
Tutorial 6 queues & arrays & results recording
 
Mcq 15-20Q15Which of the following trees are binary search tr
Mcq 15-20Q15Which of the following trees are binary search trMcq 15-20Q15Which of the following trees are binary search tr
Mcq 15-20Q15Which of the following trees are binary search tr
 
Data structures and algorithms lab4
Data structures and algorithms lab4Data structures and algorithms lab4
Data structures and algorithms lab4
 
stack.ppt
stack.pptstack.ppt
stack.ppt
 
Given the following ADT definition of a stack to use stack .docx
Given the following ADT definition of a stack to use stack .docxGiven the following ADT definition of a stack to use stack .docx
Given the following ADT definition of a stack to use stack .docx
 
Getting StartedCreate a class called Lab8. Use the same setup for .pdf
Getting StartedCreate a class called Lab8. Use the same setup for .pdfGetting StartedCreate a class called Lab8. Use the same setup for .pdf
Getting StartedCreate a class called Lab8. Use the same setup for .pdf
 
01-intro_stacks.ppt
01-intro_stacks.ppt01-intro_stacks.ppt
01-intro_stacks.ppt
 
2 b queues
2 b queues2 b queues
2 b queues
 
Lec2
Lec2Lec2
Lec2
 
Java Generics
Java GenericsJava Generics
Java Generics
 
Sorted number list implementation with linked listsStep 1 Inspec.pdf
 Sorted number list implementation with linked listsStep 1 Inspec.pdf Sorted number list implementation with linked listsStep 1 Inspec.pdf
Sorted number list implementation with linked listsStep 1 Inspec.pdf
 
In Class AssignmetzCST280W13a-1.pdfCST 280 In-Class Pract.docx
In Class AssignmetzCST280W13a-1.pdfCST 280 In-Class Pract.docxIn Class AssignmetzCST280W13a-1.pdfCST 280 In-Class Pract.docx
In Class AssignmetzCST280W13a-1.pdfCST 280 In-Class Pract.docx
 
Stack linked list
Stack linked listStack linked list
Stack linked list
 
Using NetBeansImplement a queue named QueueLL using a Linked List .pdf
Using NetBeansImplement a queue named QueueLL using a Linked List .pdfUsing NetBeansImplement a queue named QueueLL using a Linked List .pdf
Using NetBeansImplement a queue named QueueLL using a Linked List .pdf
 
Advance Java
Advance JavaAdvance Java
Advance Java
 
Ch03_stacks_and_queues.ppt
Ch03_stacks_and_queues.pptCh03_stacks_and_queues.ppt
Ch03_stacks_and_queues.ppt
 
basics of queues
basics of queuesbasics of queues
basics of queues
 

Más de Sriram Raj

Deletion From A Bst
Deletion From A BstDeletion From A Bst
Deletion From A Bst
Sriram Raj
 
Prims Algorithm
Prims AlgorithmPrims Algorithm
Prims Algorithm
Sriram Raj
 
Linked List Problems
Linked List ProblemsLinked List Problems
Linked List Problems
Sriram Raj
 
Assignment Examples Final 07 Oct
Assignment Examples Final 07 OctAssignment Examples Final 07 Oct
Assignment Examples Final 07 Oct
Sriram Raj
 

Más de Sriram Raj (20)

Interviewtcs
InterviewtcsInterviewtcs
Interviewtcs
 
Pointers In C
Pointers In CPointers In C
Pointers In C
 
m tree
m treem tree
m tree
 
M tree
M treeM tree
M tree
 
Data Structures Aptitude
Data Structures AptitudeData Structures Aptitude
Data Structures Aptitude
 
Trees Information
Trees InformationTrees Information
Trees Information
 
C Languages FAQ's
C Languages FAQ'sC Languages FAQ's
C Languages FAQ's
 
Beej Guide Network Programming
Beej Guide Network ProgrammingBeej Guide Network Programming
Beej Guide Network Programming
 
Pointers In C
Pointers In CPointers In C
Pointers In C
 
Rfc768
Rfc768Rfc768
Rfc768
 
Sctp
SctpSctp
Sctp
 
Html For Beginners 2
Html For Beginners 2Html For Beginners 2
Html For Beginners 2
 
Cracking The Interview
Cracking The InterviewCracking The Interview
Cracking The Interview
 
Html for Beginners
Html for BeginnersHtml for Beginners
Html for Beginners
 
Hash Table
Hash TableHash Table
Hash Table
 
Deletion From A Bst
Deletion From A BstDeletion From A Bst
Deletion From A Bst
 
Binary Trees
Binary TreesBinary Trees
Binary Trees
 
Prims Algorithm
Prims AlgorithmPrims Algorithm
Prims Algorithm
 
Linked List Problems
Linked List ProblemsLinked List Problems
Linked List Problems
 
Assignment Examples Final 07 Oct
Assignment Examples Final 07 OctAssignment Examples Final 07 Oct
Assignment Examples Final 07 Oct
 

Último

The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
heathfieldcps1
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
ZurliaSoop
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
KarakKing
 

Último (20)

The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 
Fostering Friendships - Enhancing Social Bonds in the Classroom
Fostering Friendships - Enhancing Social Bonds  in the ClassroomFostering Friendships - Enhancing Social Bonds  in the Classroom
Fostering Friendships - Enhancing Social Bonds in the Classroom
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptx
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
 
Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 

Queue Data Structure

  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7. Storing a queue in a static data structure (2) Continue the above example to show the state of the queue after the following operations: Add(E,Q) Remove(Q) Add(W,Q) Add(J,Q) Add(K,Q) What happens at the last of these steps?
  • 8.
  • 9.
  • 10.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16. The Queue Class (4) /* returns the number of items in the queue */ public int size() { int count = 0; for (Node current=head;current!=null; current=current.nextNode) count++; return count; }
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.
  • 23.
  • 24.
  • 25.