Re: A tree data structure?
Re: A tree data structure?
- Subject: Re: A tree data structure?
- From: BJ Homer <email@hidden>
- Date: Tue, 5 May 2009 08:46:25 -0600
You may be interested the CHDataStructures framework, hosted by the BYU
CocoaHeads group. It has a number of such structures that should work for
you.
http://cocoaheads.byu.edu/code/CHDataStructures
<http://cocoaheads.byu.edu/code/CHDataStructures>-BJ Homer
On Tue, May 5, 2009 at 7:10 AM, Andreas Grosam <email@hidden>wrote:
>
> NSTreeController and CFTree is not exactly what I'm searching for. I would
> like to have a *pure*, simple and effective but complete tree data
> structure which comprises a hierarchy of objects:
>
> root
> |- object1
> |- object2
> |- object4
> |- object5
>
>
> The container shall be sequential, that is its elements shall be ordered.
>
>
> A possible approach could look like this:
>
> @interface Tree {
> Node* root;
> }
> -(void) addObject: (NSObject)* data into:(Node*)parent;
> -(TreeEnumerator*) enumeratorOfType:(int) enumeratorType;
> - (int) count;
> ...
> @end
>
>
> Class Node contains the data and structural information:
>
> @interface Node {
> NSMutableArray* data;
> Node* parent;
> }
> -(void) addObject:(NSObject*) data;
> -(int) count;
> ...
> @end
>
>
>
> Is there already something available like this?
> Thanks in advance for hints.
>
>
> Regards
> Andreas Grosam
> _______________________________________________
>
> 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