Re: searching based on 2 keys
- From: "No Such Luck" <no_suchluck@xxxxxxxxxxx>
- Date: 30 Jun 2005 11:33:04 -0700
> Hello,
>
>Suppose I have the following table:
>
>key value
>---- -----
>
>2 foo
>24 bar
>12 baz
>
>Now I need an efficient algorithm so that I can search based on either
>the key or the value. One of the solutions is to use 2 tables - but we
>are heavily memory constrained and that is not a solution. Are there
>any other suggestions that I can try?
What are the ranges of the key? From what to what (i.e. 0 to 100000?).
What is the nature of the values? Will they always be strings of 3
chars? I don't know enough about your problem to suggest a data
structure in line with your memory restrictions.
.
- Follow-Ups:
- Re: searching based on 2 keys
- From: hungryforc
- Re: searching based on 2 keys
- References:
- searching based on 2 keys
- From: hungryforc
- searching based on 2 keys
- Prev by Date: searching based on 2 keys
- Next by Date: Re: searching based on 2 keys
- Previous by thread: searching based on 2 keys
- Next by thread: Re: searching based on 2 keys
- Index(es):
Relevant Pages
|