Re: Middle pointer for double linked list.
- From: "Maarten Wiltink" <maarten@xxxxxxxxxxxxxxxxxx>
- Date: Thu, 27 Mar 2008 09:43:36 +0100
"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
.
- Follow-Ups:
- Re: Middle pointer for double linked list.
- From: Skybuck Flying
- Re: Middle pointer for double linked list.
- References:
- Middle pointer for double linked list.
- From: Skybuck Flying
- Middle pointer for double linked list.
- Prev by Date: Re: D2006 Object inspector component
- Next by Date: Re: New to Delphi - Connecting to database using just code
- Previous by thread: Middle pointer for double linked list.
- Next by thread: Re: Middle pointer for double linked list.
- Index(es):