Re: Middle pointer for double linked list.



"Skybuck Flying" <spam@xxxxxxxxxxx> wrote in message
news:11dc5$47eb11fc$541983fa$3581@xxxxxxxxxxxxxxxxxxxxxxxxxxx

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.

How would you know on which side of the middle a modification is?

Groetjes,
Maarten Wiltink


.