Although we are using both head and tail nodes, adding to the front didn't have to explicitly reference tail!
This makes it easier to write correct code than in the case without guards.
Similarly, adding to the end doesn't need to explicitly reference head.
Write the code for addLast(E x) method below for a doubly linked list with 2 guard nodes - head and tail.
(Assume head and tail are members of the list class.)
E.g., addLast(20) should 20 to the end of this list:

to get

public void addLast(E x)
{
}