A non-circular, singly linked list Abstract Data Type has a private Node pointer, called first, 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 size to keep track of the number of nodes in the list. Given a pointer to a node n, assume that values can be read or written to by using the field names n.val and n.next 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 END 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: void delete.nth(int n) { // WRITE THE CODE THAT SHOULD BE HERE n return [10 marks] (b) Assume that this ADT has two different different methods to delete all the elements from the singly linked list as follows: void delete_all_from_start() { while (size > 0) delete-nth (0) return } void delete all from endo { while (size > 0) delete-nth (size - 1) return } Give the complexities of these two methods in big o notation and explain how you derived them. Write the pseudocode for a much simpler and more efficient method to delete all elements from the list. [10 marks] (ii) Let sart: {x Nx>0} + {y ER.y > 0} be the square root function from non-negative integers to non-negative reals, i.e. sqrt(x) = y if and only if x = y2 Is sort injective? surjective? bijective? Justify your answers. [3 marks] (iii) Let float javaSqrt(int x) be a Java implementation of this square root function (assume it throws an exception if x is negative). Discuss the differ- ences between sort and javaSqrt when considered as mathematical functions between sets. [4 marks]