• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: A tree data structure?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: A tree data structure?


  • Subject: Re: A tree data structure?
  • From: BJ Homer <email@hidden>
  • Date: Wed, 6 May 2009 20:34:17 -0600

On Wed, May 6, 2009 at 2:15 AM, Andreas Grosam <email@hidden>wrote:

>
> On May 5, 2009, at 6:54 PM, Clark Cox wrote:
>
>  On Tue, May 5, 2009 at 8:28 AM, Andreas Grosam <email@hidden>
>> wrote:
>>
>>>
>>> On May 5, 2009, at 3:21 PM, Ken Thomases wrote:
>>>
>>>>
>>>> Since you mention NSTreeController and CFTree, you may already be aware
>>>> of
>>>> this, but just in case you aren't: have you looked at NSTreeNode?
>>>>
>>>
>>> I didn't - thanks for this hint :) And it looks perfect if I decide to
>>> implement my own container, but I'm going to search some more
>>> opportunities.
>>>
>>>
>> Beyond NSTreeNode, what more do you have to implement? (i.e. there
>> needn't be any "container" for a tree data structure, it can be
>> composed completely of its nodes).
>>
> Well, this depends on your requirements and whether it is a search tree or
> a graph.
> In my actual case I wont need much functionality.
>
> Some possible requirements may be:
> copy, slice, count, rotate, enumerators with the five most common traversal
> methods, partial locks, thread safety,
> time and space complexity constraints, etc.
>
>
>>
>> Instantiate a root node, and that can be your "container", then add
>> and remove children as appropriate.
>>
> In may case, this will work since, as mentioned, I just need a graph,
> insert methods and a traversal algorithm.
>
>
> Regards
> Andreas
>

Quinn Taylor, who made the CHDataStructures framework I referenced earlier,
asked me to post the following in response to this latest post.

These links should be helpful...

-
http://dysart.cs.byu.edu/websvn/filedetails.php?path=/CHDataStructures/source/CHAbstractBinarySearchTree.m
-
http://dysart.cs.byu.edu/websvn/filedetails.php?path=/CHDataStructures/source/CHAbstractBinarySearchTree_Internal.h

Searching for "- (id) nextObject {" at the first link puts you right at the
traversal algorithms he's talking about.

Not sure what he's talking about with slice and rotate, but variants of this
code would make implementing the operations he talks about a lot easier for
an N-ary tree, although not trivial. :-)

Thanks,
  - Quinn
_______________________________________________

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

References: 
 >A tree data structure? (From: Andreas Grosam <email@hidden>)
 >Re: A tree data structure? (From: Ken Thomases <email@hidden>)
 >Re: A tree data structure? (From: Andreas Grosam <email@hidden>)
 >Re: A tree data structure? (From: Clark Cox <email@hidden>)
 >Re: A tree data structure? (From: Andreas Grosam <email@hidden>)

  • Prev by Date: Re: Problem Embedding Cocoa Framework
  • Next by Date: Re: NSXMLParser frees itself on error?
  • Previous by thread: Re: A tree data structure?
  • Next by thread: Re: A tree data structure?
  • Index(es):
    • Date
    • Thread