473,396 Members | 1,938 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,396 software developers and data experts.

Data structure

Hi All,
I am looking for what may be a good data structure to use for
a given problem.

I have to randomly insert,delete and lookup some objects - all three
being equally probable. The number of objects is in the thousands. The
keys are non integers ( but I can probably hash them to integers if
need be).

To start with I have used a hash based approach. A lot of people where
I work use splay trees but I don't think that would be a good choice
in my situation

I am looking for any other suggestions.

Thanks,
Peter
Nov 13 '05 #1
3 2232
On 27 Aug 2003 07:09:43 -0700, pe**************@yahoo.com (Peter)
wrote in comp.lang.c:
Hi All,
I am looking for what may be a good data structure to use for
a given problem.

I have to randomly insert,delete and lookup some objects - all three
being equally probable. The number of objects is in the thousands. The
keys are non integers ( but I can probably hash them to integers if
need be).

To start with I have used a hash based approach. A lot of people where
I work use splay trees but I don't think that would be a good choice
in my situation

I am looking for any other suggestions.

Thanks,
Peter


I have another suggestion, but I'm not sure you'll like it. Your
question doesn't belong here, as it has nothing to do with the C
language itself. If you re-read your post, you'll note you haven't
even mentioned C at all.

You are looking for a combination of data structure and algorithm,
which are completely independent of the programming language.

So my suggestion is ask this question in news:comp.programming, where
they discuss this kind of thing (among many other things).

Once you have an algorithm picked out, if you need help programming it
in C, come back here.

Good luck.

--
Jack Klein
Home: http://JK-Technology.Com
FAQs for
comp.lang.c http://www.eskimo.com/~scs/C-faq/top.html
comp.lang.c++ http://www.parashift.com/c++-faq-lite/
alt.comp.lang.learn.c-c++ ftp://snurse-l.org/pub/acllc-c++/faq
Nov 13 '05 #2
Peter wrote:

I am looking for what may be a good data structure to use for
a given problem.

I have to randomly insert,delete and lookup some objects - all
three being equally probable. The number of objects is in the
thousands. The keys are non integers ( but I can probably hash
them to integers if need be).

To start with I have used a hash based approach. A lot of people
where I work use splay trees but I don't think that would be a
good choice in my situation


You are OT for c.l.c, but comp.programming would be suitable. At
any rate, my hashlib library will handle the operations you
describe very nicely. See:

<http://cbfalconer.home.att.net/download/>

FUPs set to comp.programming

--
Replies should be to the newsgroup
Chuck Falconer, on vacation

Nov 13 '05 #3
Peter wrote:

I am looking for what may be a good data structure to use for
a given problem.

I have to randomly insert,delete and lookup some objects - all
three being equally probable. The number of objects is in the
thousands. The keys are non integers ( but I can probably hash
them to integers if need be).

To start with I have used a hash based approach. A lot of people
where I work use splay trees but I don't think that would be a
good choice in my situation


You are OT for c.l.c, but comp.programming would be suitable. At
any rate, my hashlib library will handle the operations you
describe very nicely. See:

<http://cbfalconer.home.att.net/download/>

FUPs set to comp.programming

--
Replies should be to the newsgroup
Chuck Falconer, on vacation
Nov 13 '05 #4

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

Similar topics

1
by: dmb000006 | last post by:
Hello, I have a database style data structure, each record has several fields. I would like to create a nested data structure that would let me 'query' the data on the value of certain...
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...
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_...
11
by: theshowmecanuck | last post by:
As a matter of academic interest only, is there a way to programmatically list the 'c' data types? I am not looking for detail, just if it is possible, and what function could be used to...
5
by: Alfonso Morra | last post by:
Hi, I am writing a messaging library which will allow me to send a generic message structure with custom "payloads". In many cases, a message must store a non-linear data structure (i.e....
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. ...
29
by: zoltan | last post by:
Hi, The scenario is like this : struct ns_rr { const u_char* rdata; }; The rdata field contains some fields such as :
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...
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:
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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.