I agree with Matt that the Java Map classes should work fine for you, even with that amount of data. I think that's your best bet for performance.
If however, you want to explore the DB method, you can easily write recursive SPs on SQL or Oracle . . . or you can even simulate DB recursion in CF using query objects and QoQ functionality. The table can be pretty basic, as I'm sure you've contemplated: My_Table ---------------- item_id PK, parent_item_id FK, left_child_item_id FK, right_child_item_id FK, level, item_value . . .you could even add a "color" field if you want to fully implement RedBlack, etc.. >From there, it's just a matter of writing the recursive SP to walk the tree in the desired manner. Storing the "level" field makes it easy to query at a desired level later on. Using QoQ, you can query the whole table into memory, then walk it recursively in CF. Either of these two methods will impart a decent amount of overhead, and wouldn't be as efficient as the Java trees. We actually use a similar setup though, due to the need to persist the tree and query it dynamically. It runs acceptably, but not as fast as a pure java tree. -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Joe Eugene Sent: Monday, March 01, 2004 8:40 PM To: [EMAIL PROTECTED] Subject: RE: [CFCDev] OT: A Good Data Structure for a Large Binary Tree >I guess I am missing what you are asking for. I am looking for the best Performing way that can accomodate a binary data structure (Either Database Model or a Java Data Structure). Java TreeMap would work but i am not sure of the efficiency since the Tree would basically have to hold about 150,000 Unique ID's in the format of Left/Right going down probably 1000 levels. I want to be able to extract any Level Info (e.g Level 20 and Below Info) from the Binary Tree without coding any kind of Recursive Methods. Appreciate your help. Thanks, Joe Eugene >-----Original Message----- >From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] >Behalf Of Matt Liotta >Sent: Monday, March 01, 2004 8:16 PM >To: [EMAIL PROTECTED] >Subject: Re: [CFCDev] OT: A Good Data Structure for a Large Binary Tree > > >I guess I am missing what you are asking for. Are you looking for a >tree implementation or are you looking for something else? > >-Matt > > >On Mar 1, 2004, at 8:11 PM, Joe Eugene wrote: > >> >> Anybody can help brain storm ideas? >> >> Thanks, >> Joe Eugene >> >> >>> -----Original Message----- >>> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] >>> Behalf Of Joe Eugene >>> Sent: Sunday, February 29, 2004 1:44 PM >>> To: cfczone; CF-Talk >>> Subject: [CFCDev] OT: A Good Data Structure for a Large Binary Tree >>> >>> >>> >>> 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 >>> >>> ---------------------------------------------------------- >>> You are subscribed to cfcdev. To unsubscribe, send an email >>> to [EMAIL PROTECTED] with the words 'unsubscribe cfcdev' >>> in the message of the email. >>> >>> CFCDev is run by CFCZone (www.cfczone.org) and supported >>> by Mindtool, Corporation (www.mindtool.com). >>> >>> An archive of the CFCDev list is available at >>> www.mail-archive.com/[EMAIL PROTECTED] >> ---------------------------------------------------------- >> You are subscribed to cfcdev. To unsubscribe, send an email >> to [EMAIL PROTECTED] with the words 'unsubscribe cfcdev' >> in the message of the email. >> >> CFCDev is run by CFCZone (www.cfczone.org) and supported >> by Mindtool, Corporation (www.mindtool.com). >> >> An archive of the CFCDev list is available at >> www.mail-archive.com/[EMAIL PROTECTED] >> > >---------------------------------------------------------- >You are subscribed to cfcdev. To unsubscribe, send an email >to [EMAIL PROTECTED] with the words 'unsubscribe cfcdev' >in the message of the email. > >CFCDev is run by CFCZone (www.cfczone.org) and supported >by Mindtool, Corporation (www.mindtool.com). > >An archive of the CFCDev list is available at www.mail-archive.com/[EMAIL PROTECTED] ---------------------------------------------------------- You are subscribed to cfcdev. To unsubscribe, send an email to [EMAIL PROTECTED] with the words 'unsubscribe cfcdev' in the message of the email. CFCDev is run by CFCZone (www.cfczone.org) and supported by Mindtool, Corporation (www.mindtool.com). An archive of the CFCDev list is available at www.mail-archive.com/[EMAIL PROTECTED] ---------------------------------------------------------- You are subscribed to cfcdev. To unsubscribe, send an email to [EMAIL PROTECTED] with the words 'unsubscribe cfcdev' in the message of the email. CFCDev is run by CFCZone (www.cfczone.org) and supported by Mindtool, Corporation (www.mindtool.com). An archive of the CFCDev list is available at www.mail-archive.com/[EMAIL PROTECTED]
