Question: Question 6 Suppose that you are given a LinkedList class represented as follows. public class LinkedList { private Node first; // pointer to first node;

Question 6 Suppose that you are given a LinkedList class represented as follows. public class LinkedList \{ private Node first; // pointer to first node; null if list is empty private class Node \{ private double item; // the data private Node next; // pointer to next node; null if no more ... Write a method delete (int k ) that removes the kth element from the list. So delete(1) should remove the element pointed to by f irst, if f irst does not hold null. If k is greater than the number of elements in the list, then delete (k) does nothing. You can assume that k>0. You may not use any methods or fields other the field first given above
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
