I am doing a dns zone type of project which has an inverted tree like you
all know.
test.com. (top node. value contains arraylist of all test.com records)
www.test.com. (node. value contains arraylist of all matching rrs)
www.sub1.test.com.
....
Bind and (probably) MSs dns, use a tree structure (i.e. red-black tree, etc)
to store and search this data. However, I am thinking this is not required.
I could just use a hash table with the ownerNames as keys. Any rr with
duplicate ownerName is stored in the node (i.e. the value object), so not
sure why I would need/want a tree when I could just use the key for a direct
lookup with the hash code. Naturally, the tree would make it easier to
convert to a GUI Tree control, but that can built by walking the hash and
figuring the heirarcy out in one pass. Although this is a dns specific
example, I am sure others have had similar dev issues with other tree like
data and could provide some thoughts. Cheers!
--
William Stacey, MVP