mmm... 1000 levels deep
I would guess that is an exceptional situation.
What is a typical level?
When I am faced with an "unsolvable" design problem, it often helps me
to examine some real data and see if any patterns reveal themselves.
If this is the case, than you can design/tune performance for the
"norm".
This is the same reasoning for sometimes making an overt decision to
denormalize a database.
A good example of this (which might apply to your problem) is to store
redundant data at a higher level of the tree or data structure to
reduce traversals.
Consider the classic db storing customer orders:
CustomerData
|
|
OrderData
|
|--- LineItem 1
|
|--- LineItem 2
|
|
|--- LineItem n
In frequent processing, you want to drill-down search/display the
database - showing all the orders by customer:
Customer AAA
Order # 123 02/10/04 $112,345.67
*
*
*
*
*
Order # 754 02/26/04 $200.34
The user would select a particular order to display the line items (and
other detail)
Now, in a truly normalized db you would need to traverse each order
record and *all* of its LineItem children so that you could compute the
order "total".
But, if you denormalize the database you can store the sum of lineItem
amounts of all the children in the OrderData record (when the order is
entered).
This is a small trade0ff of db space (and sacrifice of "pure"
normalization) -- but it pays for itself many times over in "normal"
processing of the DB.
You may find that a practical approach to the problem presents an
unorthodox but elegant solution.
HTH
Dick
On Mar 1, 2004, at 5:39 PM, Joe Eugene wrote:
> >Lots of data? why not xml?
>
> Xml parsing for large NESTED Data Structures are too slow. I probably
> will
> have
> around 150,000 Unique ID's in the Tree data Structure which can go
> deep as
> 1000 Levels. I am looking to avoid sequencial/Recursive search.
> Joe Eugene
>
> ��-----Original Message-----
> ��From: Rob [mailto:[EMAIL PROTECTED]
> ��Sent: Monday, March 01, 2004 8:24 PM
> ��To: CF-Talk
> ��Subject: Re: OT: A Good Data Structure for a Large Binary Tree
>
> ��Lots of data? why not xml?
>
> ��On Mon, 2004-03-01 at 17:11, Joe Eugene wrote:
> ��> I am trying to solve a Binary Tree data structure problem, i
> think this
> ��> can be done from a DataBase Perspective with relations but then
> that
> ��> might involve doing something like a matrix to develop the
> relations
> ��> between nodes.
> ��>
> ��> The other thought i have is solve the problem by using some
> native(Java/C++)
> ��> data Structure (Binary Tree /TreeMap) and store keys of the
> database
> ��> structure
> ��> as keys of the Binary Tree... that might relate to a simple
> select.
> ��>
> ��> Any ideas are much appreciated.
> ��>
> ��> Thanks,
> ��> Joe Eugene
> ��>
> ��>
> ��>
>
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

