Discussion in 'Mac Programming' started by Duke Leto, Feb 20, 2009.

  1. Duke Leto macrumors regular

    Mar 17, 2008
    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?
  2. autorelease macrumors regular

    Oct 13, 2008
    Achewood, CA
    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.
  3. Catfish_Man macrumors 68030


    Sep 13, 2001
    Portland, OR
    Certain implementations of NSMutableArray are looped linked lists internally, iirc. NSMutableSet is likely a tree or hash table though.

Share This Page