A tree data structure?
A tree data structure?
- Subject: A tree data structure?
- From: Andreas Grosam <email@hidden>
- Date: Tue, 5 May 2009 15:10:46 +0200
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