Complete the code to create a new node in a doubly linked list with data 10.
Node newNode = new Node([1]);The node should be created with the integer value 10 as data.
Complete the code to link the new node's previous pointer to the current tail node.
newNode.[1] = tail;The previous pointer of the new node should point to the current tail node.
Fix the error in the code to update the tail's next pointer to the new node.
tail.[1] = newNode;The tail's next pointer should point to the new node to link it forward.
Fill both blanks to correctly update the tail pointer and set the new node's next pointer to null.
tail = [1]; newNode.[2] = null;
The tail pointer should be updated to the new node, and the new node's next pointer should be null as it is the last node.
Fill all three blanks to check if the list is empty and initialize head and tail accordingly.
if (head == null) { head = [1]; tail = [2]; } else { tail.next = [3]; }
If the list is empty (head is null), both head and tail should point to the new node. Otherwise, tail's next pointer should point to the new node.
