Re: Red Black Guaruntees
- From: Ben Pfaff <blp@xxxxxxxxxxxxxxx>
- Date: Tue, 30 Oct 2007 17:13:46 -0700
"jehugaleahsa@xxxxxxxxx" <jehugaleahsa@xxxxxxxxx> writes:
By the way, is it possible to do efficient in-order iterators for a
tree if it doesn't have parent pointers?
If you don't mind taking a performance hit whenever the tree
changes, then your iterator can contain an array of the ancestors
of the current node. You can use serial numbers in the iterator
and the tree to detect when the tree has changed and thus that
the array of ancestors needs to be refreshed.
Example implementation:
http://adtinfo.org/libavl.html/Traversal-of-an-AVL-Tree.html
--
Ben Pfaff
http://benpfaff.org
.
- Follow-Ups:
- Re: Red Black Guaruntees
- From: jehugaleahsa@xxxxxxxxx
- Re: Red Black Guaruntees
- From: jehugaleahsa@xxxxxxxxx
- Re: Red Black Guaruntees
- References:
- Red Black Guaruntees
- From: jehugaleahsa@xxxxxxxxx
- Red Black Guaruntees
- Prev by Date: Re: Red Black Guaruntees
- Next by Date: Re: Red Black Guaruntees
- Previous by thread: Re: Red Black Guaruntees
- Next by thread: Re: Red Black Guaruntees
- Index(es):
Relevant Pages
|