1<=>2<=>3<=>4 ==> 1<=>2<=>3
next
reference point to null.
1. Traverse to the last node
of the list
.
2. Keep track of the node previous to the current node
at each step in the traversal.
3. Once the last node
is reached, point its previous node's next
to null
.
4. Point last node's previous
to null
.
5. Return head node
.
public DoublyLinkedNode deleteAtTail(DoublyLinkedNode head) { }
C
Java
Python