Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Duke Leto

macrumors regular
Original poster
Mar 17, 2008
166
0
I've been looking through the docs.. and it seems that the best way to store data that can will be most likely removed is by using a set. I have previously made a linked list in ActionScript, but my Hard drive died.

It just seems too good to be true! Is it possible that an NSMutableSet is basically a linked list?
 

autorelease

macrumors regular
Oct 13, 2008
144
0
Achewood, CA
I've been looking through the docs.. and it seems that the best way to store data that can will be most likely removed is by using a set. I have previously made a linked list in ActionScript, but my Hard drive died.

It just seems too good to be true! Is it possible that an NSMutableSet is basically a linked list?

I'm sure it's implemented with a hash table to allow amortized constant-time operations. Lookups in a linked list are very slow. I doubt linked lists are used anywhere in Foundation.
 

Catfish_Man

macrumors 68030
Sep 13, 2001
2,579
2
Portland, OR
Certain implementations of NSMutableArray are looped linked lists internally, iirc. NSMutableSet is likely a tree or hash table though.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.