subject

Use Python Write a Queue class. The class is detailed as follows:
●__init__(self, capacity) → None
oComplexity: O(1)
oValid Input: An integer in (0, ∞]. Use a default, valid capacity on invalid input.
oThis is the constructor for the class. You will need to store the following here:
▪The head pointer
▪The tail pointer
▪A variable maxSize
▪A variable currentSize
▪Any other instance variables you want.
●enqueue(self, ticket) → boolean
oComplexity: O(1)
oValid Input: An object of type: MealTicket. Return False on invalid input.
oThis is the enqueue method. It will add a meal ticket to the queue. It will then return True/False depending on if the enqueue was successful (Hint: Add a new ticket at the tail of the queue).
●dequeue(self) → MealTicket/ boolean
oComplexity: O(1)
oThis is the dequeue method. It will remove the ticket at the front of the queue andreturn it or False if the queue is empty. (Hint: Dequeue a ticket at the head of theQueue).
●front(self) → MealTicket/ boolean
oComplexity: O(1)
oThis method lets the user peak at the ticket at the front of the queue without deleting it. It will either return a meal ticket or false if the queue is empty.
●isEmpty(self) → boolean
oComplexity: O(1)
oThis method will return True/False depending on if the queue is empty or not.
●isFull(self) → boolean
oComplexity: O(1)
oThis method will return True/False depending on if the queue is full or not,

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 16:10
When copying and pasting text, the first step is move your cursor type the text select the copy command select the paste command
Answers: 2
question
Computers and Technology, 23.06.2019 23:40
Which of the following calculates the total from the adjacent cell through the first nonnumeric cell by default, using the sum function in its formula? -average -autosum -counta -max
Answers: 1
question
Computers and Technology, 24.06.2019 20:50
Which key function of a business involves finding, targeting, attracting, and connecting with the right customers?
Answers: 3
question
Computers and Technology, 25.06.2019 04:30
What is the purpose of network permissions? a)to control access to network resources b)to convert to wireless networking c)to enable the installation of nics d)to reduce operating costs
Answers: 1
You know the right answer?
Use Python Write a Queue class. The class is detailed as follows:
●__init__(self, capacity) →...
Questions
Questions on the website: 13722361