searching based on 2 keys



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?

Thanks,
~Gee

.



Relevant Pages

  • Re: OT: Why is C so popular?
    ... > about the indent program at the time? ... if foo: ...
    (Debian-User)
  • Re: how to deserialize variable element/node
    ... string bar; ... baz[] Baz; ... Your two XML fragments would have to be represented in an XML schema by ...
    (microsoft.public.dotnet.xml)
  • Re: Regular Expressions...
    ... (foo, bar, baz) ... an object which allows access to the grouped matches as a sequence. ...
    (comp.lang.python)
  • Re: macros
    ... (:method ((foo foo) ... (baz baz)) ... in Anonymous C Lisper's post (bar bar)" ... latter so you know that this is actually the generic function you want). ...
    (comp.lang.lisp)
  • Re: searching based on 2 keys
    ... >24 bar ... >12 baz ... >Now I need an efficient algorithm so that I can search based on either ...
    (comp.programming)