Solved

In the Following Code for the Add Method for a Linked

Question 29

Multiple Choice

In the following code for the add method for a linked queue implementation, what is the missing code? def add(self, newItem) :
NewNode = Node(newItem, None)
If self.isEmpty() :
Self.front = newNode
Else:
Self.rear.next = newNode
< missing code >
Self.size += 1


A) self.rear = newNode
B) self.rear -= 1
C) self.rear.prev = None
D) self.front = self.next

Correct Answer:

verifed

Verified

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions