Question: Problem 1 Enhance the LinkedList class by adding following methods to do some more operations of the linked list: 1. insertAt(pos, data): inserts the element

Problem 1 Enhance the LinkedList class by adding following methods to do some more operations of the linked list: 1. insertAt(pos, data): inserts the element data at position pos of the list. If position exceeds the length of the list throw an exception. Example: List: 4 672 insertAt(2, 8) List: 4 6872 insertAt(0, 9) List: 946872 insertAt(-1,10) IllegalArgumentException List: 94 6872 insertAt(8, 12) IndexOutOfBoundsException List: 94 6872
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
