Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Consider the following definition of a node for a linked list together with a co

ID: 3904401 • Letter: C

Question

Consider the following definition of a node for a linked list together with a constructor. Refer to this in the questions below public class Node char key; Node next; Node (char el) f key- el; next- null; a. (2 marks) Consider the following code snippet (located within the class Node) where head refers to the first nodein a linked list which has already been initialised Node y- new Node('Z'); head- y; Complete the line at 7777 so that the completed code adds the new node containing "z' to the front of the linked list, and updates head so that it points to the added node.

Explanation / Answer

If you have any doubts, please give me comment...

Node y = new Node ('Z');

Node head = null; // declaring head variable

head = y;