Middle pointer for double linked list.



Hello,

Little idea:

Keep track of a middle pointer for a double linked list.

Each time two nodes are added on the same side move the middle pointer
accordingly.

Do the same vice versa for removing twice from the same side.

Only problem is when removing nodes twice from the same side for uneven
sides, when only two nodes are left the middle pointer would not be updated
and would keep pointing to a non existing node.

Bye,
Skybuck.


.