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
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'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.
 
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.