Question: java code, my doublylinkedlist has a dummy head and tail, index 0 starts at element after the head and ends at before tail. size doesn't
java code, my doublylinkedlist has a dummy head and tail, index 0 starts at element after the head and ends at before tail. size doesn't include dummy nodes

Part 5 (EC) - Extending DoublyLinkedList In this part, you will implement two methods that work with the doubly-linked list. public void removeMultipleof (int base) Remove nodes whose index is a multiple of base before removal. To check whether an index is a multiple of base, you can calculate whether index mod base equals to 0. For example, if the base is 3, you should remove all elements at index 0, 3, 6, 9, ... @throws IllegalArgumentException - base is less than 1 public void swap Segment (DoublyLinkedList other, int splitIndex) Given another linked list (other), swap the nodes (not just elements, which means you need to swap the references) between index 0 and splitIndex (inclusive) in both lists. Make sure you update the instance variables of both lists properly. Example: Before swap: this -> [0, 1, 2, 3, 4], other -> [9, 8, 7, 6, 5, 4, 3], splitIndex -> 2 After swap: this -> [9, 8, 7, 3, 4], other -> [0, 1, 2, 6, 5, 4, 3] You can assume other is not null, and the size of both lists is greater than splitIndex + 1 (e.g. if splitIndex is 2, you can assume the size of both lists greater than 3)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
