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, 21.06.2019 21:00
Is it ok to use a does red wine clean the inside of a computer true or false
Answers: 2
question
Computers and Technology, 22.06.2019 16:00
Why should characters such as / \ " ' * ; - ? [ ] ( ) ~ ! $ { } < > # @ & | space, tab, and newline be avoided in file names?
Answers: 2
question
Computers and Technology, 23.06.2019 03:30
Ihave a singular monitor that is a tv for my computer. recently, i took apart my computer and put it back together. when i put in the hdmi cord and booted the computer to see if it worked, the computer turned on fine but the screen was blue with "hdmi no signal." i've tried everything that doesn't require buying spare parts, any answer is appreciated!
Answers: 1
question
Computers and Technology, 24.06.2019 22:00
Iam trying to get my google account back for school and business, can someone ?
Answers: 1
You know the right answer?
Use Python Write a Queue class. The class is detailed as follows:
●__init__(self, capacity) →...
Questions
question
Mathematics, 23.09.2019 13:50
question
Mathematics, 23.09.2019 13:50
Questions on the website: 13722361