The right Data Structure for the job

R

Ron M. Newman

Hello Gurus--

I have a collection of attributed elements. Each element can have n number
of named attributes and a value. Let's assume each element represents a
person and one of the properties is "age" (integer, although byte would do
the trick as well, eh?).

I'd like to write an *efficient* method that allows me to query on different
attributes and return collections of elements that match certain criterias
like: "give me all elements with attribute "age" between 25 and 35".

hashing tables only work on comparison queries. I can create a hashing table
that uses age as key and references the element, but I can't query it for
ranges, only for exact values, and there is that duplicate key problem...
not good.

any ideas what I should use? I mean, I can use sorted lists of 'keys' and
maintain them myself and do binary search for the 'beginning' of a key and
move on until i step out of range. I wanted to know if .NET has anything
that addresses this problem.

thanks

Ron
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top