Complete the code to create a new node and insert it at the beginning of the linked list.
Node newNode = new Node(data);
newNode.[1] = head;
head = newNode;The new node's next pointer should point to the current head to insert it at the beginning.
Complete the code to update the head pointer after inserting the new node.
Node newNode = new Node(data);
newNode.next = head;
[1] = newNode;After inserting at the beginning, the head pointer must be updated to the new node.
Fix the error in the code that inserts a new node at the beginning of the list.
Node newNode = new Node(data);
newNode.next = [1];
head = newNode;The new node's next should point to the current head, not to itself or null.
Fill both blanks to complete the method that inserts a new node at the beginning of the linked list.
public void InsertAtBeginning(int data) {
Node newNode = new Node(data);
newNode.[1] = head;
[2] = newNode;
}The new node's next points to the current head, and then head is updated to the new node.
Fill all three blanks to complete the linked list insertion at the beginning with proper node creation and head update.
public void InsertAtBeginning(int data) {
Node [1] = new Node(data);
[1].[2] = head;
[3] = [1];
}Create a new node named newNode, set its next to the current head, then update head to newNode.
