On Tue, Nov 16, 2010 at 7:18 PM, Sunil S Nandihalli <
sunil.nandiha...@gmail.com> wrote:

> Thanks Christopher Grand. I really like your scaffold .. would be extremely
> handy .. Like david suggested .. it would be a perfect candidate for
> inclusion in the clojure.repl
>
> Regarding your bimap implementation, in terms of complexity, I feel, it
> will be linear in the number of elements, when accessing the pair via the
> value .. Is that true?
>
> Sunil
>
>
You could use the same technique he described to implement a bimap that's
stored internally as two hash maps (keys->vals, vals->keys).

Alternatively, you could use some sort of simple relational database and
build an index on both columns to support queries from either keys or
values.  In addition to the many off-the-shelf databases that you can access
from Clojure (SQLite, MySQL, MongoDB, etc.), you could take a look at
clojure.contrib.datalog and FleetDB which provide in-memory relational
databases.

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to