COSC 311 Homework 1/17/2017 Recursive print a linked list stored in 1D array Distributed: 1/17/2017 Due: 1/19/2017 Write Java code that will recursively print elements of a linked list in order. The linked list is stored as a 1D array. Each element in the array references a Node containing int data and int next. The field int next is the index location of the successor element in the linked list. The LinkedList data structure contains data fields: Node[] array and int head. For example: head = 5; Node[] array as shown: index 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | ---------------------------------------------------- | | | | | | | | | | null | \/ \/ \/ \/ \/ \/ \/ \/ \/ data 5 | 4 | 3 | 1 | 2 | 5 | 7 | 9 | 2 | | next -1 | 3 | 0 | 6 | 5 | 1 | 0 |-1 | 3 | | stores the linked list: 5, 4, 1, 7, 5. The end of list is indicated with value -1. Pseudo-code for a recursive print() of a linked list: void print(LinkedList list) { if (list is empty) return; output(first element of list); print(list with first element removed); // e.g. list -> next return; } Initialization: Initialize a singly linked list with hard-coded input. Use a 1D array of ints to supply the hard-coded input. Make the list as shown above. Output: The values of the linked list: 5, 4, 1, 7, 5 Data structure: Singly linked list (LinkedList) of nodes (Node), implemented in 1D array of Nodes: Node[] array. Each Node contains only int data and int next. LinkedList contains two data members: int head, Node[] array. Constraints: -- Do not use any built-in Java classes beyond primitive types (e.g., int), System, and String. You must write Node and LinkedList. -- Node class and LinkedList class must be in the same file. -- Use a maximum array size of 10. -- You may not create any new Nodes. Turn in: Hardcopy of your code. In your code, include a header: [your name] [your URL] COSC 311 HW 01/17 WINTER 2017 Do NOT comment your code. Output for a run on data given in the example above. Note, the array size must be 10 and there are 'junk' values in the array.