Data structure

P

Peter

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
 
J

Jack Klein

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

LibraryUser

Peter said:
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
 
L

LibraryUser

Peter said:
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
 

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

Members online

Forum statistics

Threads
474,077
Messages
2,570,568
Members
47,204
Latest member
abhinav72673

Latest Threads

Top