Question: Implement the below function for the queue: a. IsEmpty: This is left as an exercise for the user. Take a variable, which will take care
Implement the below function for the queue:
a. IsEmpty: This is left as an exercise for the user. Take a variable, which will take care of the size of a queue if the value of that variable is zero, isEmpty should return true. If the queue is not empty, then it should return false.
b. Size: Use the size variable to be used under size function call.
Size() function should return the number of elements in the queue.
Step by Step Solution
3.43 Rating (150 Votes )
There are 3 Steps involved in it
class Queue def initself selfitems def isEmptyself ret... View full answer
Get step-by-step solutions from verified subject matter experts
