Question: A non-circular, singly linked list Abstract Data Type has a private Node pointer, called which points to the first node of the list. This ADT

A non-circular, singly linked list Abstract Data Type has a private Node pointer, called which points to the first node of the list. This ADT does not maintain a header pointer to the last node of the list, but it does maintain a variable to keep track of the number of nodes in the list. Given a pointer to a node assume that values can be read or written to by using the field names and for the value and next fields of the node respectively. Assume that a garbage collector is being used, so nodes do not need to be explicitly freed. Use for invalid or null address pointer values. (a) delete.nth(int n ) is a non-recursive method of the ADT that removes node number n from the list and throws an IllegalArgumentException if no such element exists or if n is less than 0 . The first node is numbered 0. Fill in the missing part of the pseudocode for this function below: 1223455voiddeletenth(intI/WRITETHECODETHATSHOULDBEHEREreturn [10 marks]
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
