Best Text/ID matching algorithm

Discussion in 'iOS Programming' started by mahendraraut, Nov 9, 2011.

  1. mahendraraut macrumors newbie

    Joined:
    Nov 9, 2011
    #1
    I am integrating/syncronising three different API's in one application

    first API(1) will provide me the folder(folder(1)_id, folder(1)_name)
    second API will provide folder(folder(1)name, parent_folder(1)__id)

    I need to keep above in one table and need to compare with third API,
    if that contains same folder name as existing folder(folder(1)_name) then keep them as it is and if there are no folders with same name then add it from 1st and 2nd API and vice a versa. there is no limitation on number of folders

    I also need to keep track of all for future sync.

    what will be optimal way to do this in (i-phone)objective-c?
    I heard about the Hash-map, hash-table and Dictionary or I can simply use array for that, can anybody suggest easy/faster way to do this, any existing references? please.
     
  2. PhoneyDeveloper macrumors 68030

    PhoneyDeveloper

    Joined:
    Sep 2, 2008
    #2
    NSDicationary and NSSet are implemented as hash tables and will give you a fast and convenient way to tell if a string is present in those containers.

    I use NSDictionary all-day every day for a million different tasks. NSSet not as much. It will serve you well to learn how to use it.
     

Share This Page