def enqueue(self, x): if self.count == 0: self.front = LinkedListNode(x) self.back = self.front else: temp = LinkedListNode(x) self.back.setNext(temp) self.back = temp self.count += 1
def enqueue(self, x): """Puts the given object into the queue, at the back.""" if self.count == 0: self.front = LinkedListNode(x) self.back = self.front else: temp = LinkedListNode(x) self.back.setNext(temp) self.back = temp self.count += 1
def append(self, data): new_node = LinkedListNode(data) if self.head == None: self.head = new_node return