Question: Question 3: Extend the UnorderedList class by adding the clear(self) method that clears all of the items from the linked list. After this operation is

Question 3: Extend the UnorderedList class by adding the clear(self) method that clears all of the items from the linked list. After this operation is completed, the length of the list is zero. Note: you dont need to remove elements from the linked list one by one. The implementations of the Node and LinkedListIterator are provided to you as part of this exercise. You can simply use: Node(), get_next(), as well as get_data() as necessary in your function definition. Note: include the entire class definition, including the size(self), in your answer to this question. =========================================================== For Example: =========================================================== Test: my_list = UnorderedList() for i in range(10): my_list.add(i) my_list.clear() print(my_list.size()) =========================================================== Result: 0 ===========================================================

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!