Question on binary search Trie
- From: matt <rottyguy70@xxxxxxxxx>
- Date: Thu, 22 Nov 2007 07:07:34 -0800 (PST)
Hello, I'm reading a paper that refers to using a (Digital) Binary
Search Trie to map keys into a table full of buckets. The trie is
comprised of the bits of the key (in reverse order). It is intended
to easily support manipulation of the "buckets" in the table (addition/
removal). My question refers to rebalancing the trie on removal of
nodes. I'll provide an example below (unfortunately, I have trouble
documenting tries in messages so forgive any formatting issues).
Given the following binary keys, their bucket mapping, and values
contained in said bucket.
00->Bucket A->gary, lori
01->Bucket B->kim
* (root)
0 (parent)
0 (A:gary, lori) 1 (B:kim)
Here the removal of gary or kim would promote the other bucket to the
parent (0) node and thus any searches (or insertion) for gary, lori or
kim will still work correctly and refer to the newly promoted bucket
since all keys share the 0th LSB. This I understand. It is when the
trie is deeper that is causing me confusion. Following the same
example, let's add more values
00->Bucket A->gary, lori
010->Bucket B->kim
011->Bucket C->tom
*
0 (parent) 1 (Z)
0(A) 1
0(B) 1(C)
Again, appologies for any misformatting on the trie. So what happens
here when we remove Bucket A? Do both Bucket B and C (and any of
their children) get promoted to parent 0 since they only share the 0
LSB with A? Thus:
*
0 (B,C, {all children of B&C}) 1 (Z)
Is this correct?
TIA
.
- Prev by Date: In-place list manipulation
- Next by Date: Re: In-place list manipulation
- Previous by thread: In-place list manipulation
- Next by thread: x windows
- Index(es):
Relevant Pages
|