NSMutableSet

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

  1. macrumors regular

    Joined:
    Mar 17, 2008
    #1
    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. macrumors regular

    Joined:
    Oct 13, 2008
    Location:
    Achewood, CA
    #2
    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. macrumors 68030

    Catfish_Man

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

Share This Page