Re: rb-tree creation from sorted sequence
- From: Ben Pfaff <blp@xxxxxxxxxxxxxxx>
- Date: Tue, 22 Nov 2005 12:58:47 -0800
Arne Ehrlich <newsreaderREMOVETHIS@xxxxxxxxxx> writes:
> I've been trying to find a Paper describing a method to
> construct a red-black tree from a sorted sequence in
> linear time.
>
> Does anyone remember articles/papers about this issue?
There is a rather nice O(n) time, O(1) additional space algorithm
for fully balancing a binary tree. I have a description of it
(although I did not invent it) at
http://adtinfo.org/libavl.html/Balancing-a-BST.html
Once you have a balanced tree, you can just color the nodes.
--
Peter Seebach on managing engineers:
"It's like herding cats, only most of the engineers are already
sick of laser pointers."
.
- References:
- rb-tree creation from sorted sequence
- From: Arne Ehrlich
- rb-tree creation from sorted sequence
- Prev by Date: Re: Filling 2d array in less than O(n^2)?
- Next by Date: Re: hash,index, dictionary
- Previous by thread: Re: rb-tree creation from sorted sequence
- Next by thread: Bag intersections to create trees from bigger bags
- Index(es):
Relevant Pages
|