Skip navigation.
 
mlRe: Best Way To Lookup From a Huge Table
FROM : John Stiles
DATE : Thu Mar 13 22:27:47 2008

NSDictionary should be all you need here. It internally uses a hash
table to find keys, so it should be extremely fast.


Karan Lyons wrote:
>    What's the best way to lookup something from a huge table?
>    I'm trying to write a piece of code that checks weather data given
> a zipcode. But I first need to change that zipcode into another format
> in order for it to work with the online service I'm querying. For
> example:
>
>    1) User inputs zipcode 02139.
>    2) Application looks up zipcode in table and finds that 02139 is
> USMA0007
>    3) Application uses code USMA0007 to query the online service.
>
>    The table itself is pretty simple: It's just two columns, one with
> every zipcode in the US, and the other with the corresponding weather
> code. But there are 41,805 zipcodes in the US, so I'm not sure of the
> best way to implement this. The table only needs to be queried once,
> after that I can store the weather code in memory.
>    What's the best way to do this? Thanks for your help!
>
> Namaste,
> Karan
> ------------------------------------------------------------------------
>
> _______________________________________________
>
> Cocoa-dev mailing list (<email_removed>)
>
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/<email_removed>
>
> This email sent to <email_removed>

Related mailsAuthorDate
mlBest Way To Lookup From a Huge Table Karan Lyons Mar 13, 22:11
mlRe: Best Way To Lookup From a Huge Table John Stiles Mar 13, 22:27
mlRe: Best Way To Lookup From a Huge Table Jens Alfke Mar 13, 23:30
mlRe: Best Way To Lookup From a Huge Table Chris Hanson Mar 15, 01:31
mlRe: Best Way To Lookup From a Huge Table John Stiles Mar 15, 01:55
mlRe: Best Way To Lookup From a Huge Table Chris Hanson Mar 15, 02:15
mlRe: Best Way To Lookup From a Huge Table Ben Trumbull Mar 15, 02:39
mlRe: Best Way To Lookup From a Huge Table Scott Ribe Mar 15, 03:35
mlRe: Best Way To Lookup From a Huge Table Paul Thomas Mar 16, 10:19
mlRe: Best Way To Lookup From a Huge Table John Stiles Mar 17, 01:26
mlRe: Best Way To Lookup From a Huge Table Thomas Davie Mar 17, 17:31
mlRe: Best Way To Lookup From a Huge Table James Hober Mar 17, 19:38
mlRe: Best Way To Lookup From a Huge Table Scott Ribe Mar 19, 01:22
mlRe: Best Way To Lookup From a Huge Table E. Wing Mar 21, 00:58
mlRe: Best Way To Lookup From a Huge Table Michael Ash Mar 21, 05:48
mlRe: Best Way To Lookup From a Huge Table John Stiles Mar 21, 17:13
mlRe: Best Way To Lookup From a Huge Table Michael Ash Mar 21, 21:37
mlRe: Best Way To Lookup From a Huge Table John Stiles Mar 21, 21:51
mlRe: Best Way To Lookup From a Huge Table Michael Ash Mar 21, 22:03
mlRe: Best Way To Lookup From a Huge Table John Stiles Mar 21, 22:08
mlRe: Best Way To Lookup From a Huge Table Thomas Engelmeier Mar 22, 19:46