473,378 Members | 1,152 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

The right Data Structure for the job

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

Jun 26 '06 #1
2 1040
How about using a datatable and dataview?

Ron M. Newman wrote:
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


Jun 26 '06 #2
Hello Ron,

You may want to look into LINQ.

-Boo
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

Jun 26 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Mike Jones | last post by:
need help with data structures.Looking for ways to start, sample code, anything Program description: Design and implement a Visual C++ .NET program that inserts values into a data...
1
by: googleo | last post by:
Hi, in my application I want to handle and store data in a hierarchic data structure. For example: persons who manage houses; houses have various numbers of floors; floors have various numbers...
2
by: yee young han | last post by:
I need a fast data structure and algorithm like below condition. (1) this data structure contain only 10,000 data entry. (2) data structure's one entry is like below typedef struct _DataEntry_...
16
by: Alex Clark | last post by:
Hi All, I'm sure this must have been asked a million times due to it's usefulness, but are there any sensible solutions for disabling right click (and other services such as Ctrl+P, Browser...
3
by: Kiran B. | last post by:
Hi, I am new to .net. I have two Data Structure Type ... Sturcture A and Structure B. Structure A Public Fname as String Public LastName as String Public City as String Public Zip as String...
11
by: Macca | last post by:
Hi, I'm writing an application that will pass a large amount of data between classes/functions. In C++ it was more efficient to send a pointer to the object, e.g structure rather than passing...
3
by: aurora | last post by:
This is an entry I just added to ASPN. It is a somewhat novel technique I have employed quite successfully in my code. I repost it here for more explosure and discussions. ...
30
by: Charles Law | last post by:
Here's one that should probably have the sub-heading "I'm sure I asked this once before, but ...". Two users are both looking at the same data, from a database. One user changes the data and...
3
by: | last post by:
I have an simple app that pulls UDP socket packets off a network, places that packet data in a structure, and places the structure into a vb.net Queue (use enqueue. and dequeue). Writes queue to...
7
by: David | last post by:
i think i just realized i'm an idiot. again. (not syntactically correct code... just pieces to illustrate) class StateObject { members like socket, receiveBuffer, receiveBufferSize,...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.