Question: Please give some insight into this: Consider the following Python code, which defines the append operation to add a new node to the end of
Please give some insight into this:

Consider the following Python code, which defines the append operation to add a new node to the end of a Linked List: def append(self, data) new myNode = Node(data) if self.isEmpty() self._head = myNode else: current = self._head while current.getNext() != None current = current.getNext() // at the end current.setNext(myNode) Revise this code (you may start by copying and pasting this code into the answer box and modifying from there) to reflect the fact that the Linked List class also has an attribute (_tail) which references the last node in the list
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
