• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Datastructures...vb

Bloodstein

Senior member
Hi,

I need a datastructure to store data that has a structure similar to a tree. The tree can have multiple children (not constrained to 2). Each child can have only one parent.

I'm thinking at the moment of implementing a Graph data structure (which is really an expanded tree). However, i dun need the complexity associated with one child being able to belong to two parents.

The data structure has to be extremely efficient in sorting data "horizontally" (ie. across parents) as opposed to vertically. Searching is also an important feature so that has to be pretty efficient as well. Efficiency for adding and removing data is more relaxed.

So, any suggestions on an appropriate data structure is welcome. I would be implementing the data structure in VB. Also, I'd really hate to go out an code the whole data structure, so any help on places where i can find VB implementation of those data structures (or any other language that is easy to port to VB) would be really really really appreciated. Even better, any reference to existing data structure in VB that handles my situation would be appreciated (I'm thinking 'bout the TreeNode that TreeView control uses....but, wat do u guys think?)

Thanks
 
The balanced tree is known as Splay Tree. When you add a node, it will adjust the tree path to make it balanced. The COM Object Scripting.Dictionary may be your choice.
 
Back
Top