Question: We implemented the C_RefUnsortedList by maintaining a single reference, the last element of the list. Suppose we changed our approach so that we maintain two
We implemented the C_RefUnsortedList by maintaining a single reference, the last element of the list. Suppose we changed our approach so that we maintain two references into the linked list, one to the first list element and one to the last list element. Would the new approach necessitate a change in the class constructor? If so. describe the change. Would the new approach necessitate a change in the getNext method? If so, describe the change. Would the new approach necessitate a change in the find method? If so, describe the change. Would the new approach necessitate a change in the add method? If so. describe the change. We implemented the C_RefUnsortedList by maintaining a single reference, the last element of the list. Suppose we changed our approach so that we maintain two references into the linked list, one to the first list element and one to the last list element. Would the new approach necessitate a change in the class constructor? If so. describe the change. Would the new approach necessitate a change in the getNext method? If so, describe the change. Would the new approach necessitate a change in the find method? If so, describe the change. Would the new approach necessitate a change in the add method? If so. describe the change
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
