Question: In the method to _ last ) from the previous question, we said you could assume that ( self ) was not an empty linked
In the method tolast from the previous question, we said you could assume that self was not an empty linked list. Why did we want you to make this assumption when completing the code?
The code would raise a TypeError because None cannot be compared against a Node object.
The code would raise an IndexError because an empty linked list has no "last" item.
No reason; the code as written would satisfy its docstring even when the linked list is empty.
The code would raise an AttributeError because curr would be initialized to None.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
