• 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
A tree data structure?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: A tree data structure?
      • From: BJ Homer <email@hidden>
    • Re: A tree data structure?
      • From: Ken Thomases <email@hidden>
  • Prev by Date: masking events from Image Well
  • Next by Date: Re: A tree data structure?
  • Previous by thread: Re: masking events from Image Well
  • Next by thread: Re: A tree data structure?
  • Index(es):
    • Date
    • Thread