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

Other questions on the subject: Computers and Technology

image
Computers and Technology, 23.06.2019 08:00, seaotter7140
Michael has written an e-mail to his employees that describes a new product special that will be introduced to the customers next week. by taking time to make sure the e-mail is well written, logical, and organized, michael has made sure his message has the characteristics of a) effective communicationb) ineffective communicationc) barriers to communicationd) workplace communication
Answers: 2
image
Computers and Technology, 24.06.2019 00:00, Kaylaonfleek0956
Consider the series where in this problem you must attempt to use the ratio test to decide whether the series converges. compute enter the numerical value of the limit l if it converges, inf if it diverges to infinity, minf if it diverges to negative infinity, or div if it diverges but not to infinity or negative infinity.
Answers: 1
image
Computers and Technology, 24.06.2019 07:20, djs1002
Ingrid started speaking about her slide presentation. when she clicked to th"third slide, which had just a picture of an elephant, she forgot what she wassupposed to talk about. what could ingrid do to avoid this situation in thefuture? oa. print handouts for her audience. ob. add presenter's notes to each slide. oc. add a video to each slide. od. save her slide presentation to a flash drive
Answers: 2
image
Computers and Technology, 24.06.2019 12:00, tipbri6380
An npn transistor is correctly biased and turned on if the a. base is negative. b. collector is negative. c. collector is positive with respect to the emitter and negative with respect to the base. d. collector is the most positive lead followed by the base.
Answers: 1
You know the right answer?
Use Python Write a Queue class. The class is detailed as follows:
●__init__(self, capacity) →...

Questions in other subjects: