Re: A tree data structure?
Re: A tree data structure?
- Subject: Re: A tree data structure?
- From: Andreas Grosam <email@hidden>
- Date: Wed, 6 May 2009 10:24:11 +0200
On May 5, 2009, at 7:19 PM, WT wrote:
On May 5, 2009, at 5:52 PM, Graham Cox wrote:
On 06/05/2009, at 1:28 AM, Andreas Grosam wrote:
Please don't underestimate the effort to "just roll your own".
Nor overestimate it ;-)
Bear in mind that a simple tree can be implemented using multiple
instances of just one small object, the node itself. Usually that's
all you have to code and it's all self-referential.
--Graham
Please let's not forget that a tree data structure is often pretty
much useless without some form of balancing. Otherwise, in the worst
case, what you really have is a degenerate form of your tree (such
as a linked list for binary trees). Getting a balancing algorithm
(such as node rotations in a red-black tree) done right is no
trivial task, so I would agree with Andreas' comment not to
underestimate the effort required to roll one's own.
In case of a search tree, I do agree - these beasts are the most
complex data structures around. I guess, there are about 5 dozens of
different trees and variations - and each may have a dozen of
different implementation strategies.
Even a sophisticated graph is a ton of code.
Luckily, I don't need such a beast. ;) I just need a graph, a
hierarchical data container - no search tree.
Regards
Andreas
Wagner
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden