0% found this document useful (0 votes)
2 views26 pages

Intro Queue

The document contains repeated mentions of the name Girisha Chandrashekhar and includes a Python program that demonstrates how to create a queue using the 'queue' module. The program adds elements to the queue and displays them, showing the size of the queue before and after removal of elements. It highlights the basic operations of inserting and displaying elements in a queue.

Uploaded by

ttasmiya899
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views26 pages

Intro Queue

The document contains repeated mentions of the name Girisha Chandrashekhar and includes a Python program that demonstrates how to create a queue using the 'queue' module. The program adds elements to the queue and displays them, showing the size of the queue before and after removal of elements. It highlights the basic operations of inserting and displaying elements in a queue.

Uploaded by

ttasmiya899
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Girisha Chandrashekhar

Girisha Chandrashekhar
Girisha Chandrashekhar
Girisha Chandrashekhar
Girisha Chandrashekhar
Girisha Chandrashekhar
Girisha Chandrashekhar
Girisha Chandrashekhar
Girisha Chandrashekhar
Girisha Chandrashekhar
Girisha Chandrashekhar
Girisha Chandrashekhar
Girisha Chandrashekhar
Girisha Chandrashekhar
Girisha Chandrashekhar
Girisha Chandrashekhar
Girisha Chandrashekhar
Girisha Chandrashekhar
Girisha Chandrashekhar
Girisha Chandrashekhar
Girisha Chandrashekhar
Girisha Chandrashekhar
Girisha Chandrashekhar
Girisha Chandrashekhar
Girisha Chandrashekhar
A14. Write a python program to add and display elements from
# Create a Queue object
a queue using list
q = [Link]()
# python program to add and display elements from a queue
# Add elements to the queue using put()
using list
[Link](10)
# Create Queue and perform insert and delete
[Link](20)
[Link](30)
import queue
print('Queue size after INSERT is ', [Link]())
# Display the elements in the queue
# Display the elements in the queue
def display_queue(q):
display_queue(q)
print("Queue elements are:", end=" ")

while not [Link]():


element = [Link]()
print(element, end=" ")
print('\n Queue size after REMOVE is ', [Link]())

Girisha Chandrashekhar

You might also like