Table data structure in C ?

R

Richard

Does anyone know of a fast implementation of a "table" data structure--
an arbitrary number of columns and rows--with the features of fast field
location and update, along with the ability to quickly add and delete
columns and rows? Something including the algorithm analysis would be
an even niftier thing to see.

It's gotta be sound enough to be reasonably equivalent in performance at
the two extremes: lots of rows and only a few columns, or a lot of
columns with only a few rows.

I'm thinking I'm smoking crack here just to think there is such a thing,
but then I'm thinking odds are pretty good that I don't know everything.

GNU GCC 3.3, but I'd prefer not to use any funny language extensions.
 
D

Dann Corbit

Richard said:
Does anyone know of a fast implementation of a "table" data structure--
an arbitrary number of columns and rows--with the features of fast field
location and update, along with the ability to quickly add and delete
columns and rows? Something including the algorithm analysis would be
an even niftier thing to see.

It's gotta be sound enough to be reasonably equivalent in performance at
the two extremes: lots of rows and only a few columns, or a lot of
columns with only a few rows.

I'm thinking I'm smoking crack here just to think there is such a thing,
but then I'm thinking odds are pretty good that I don't know everything.

GNU GCC 3.3, but I'd prefer not to use any funny language extensions.

You really want
If the columns are all the same type, look do a web search for "sparse
matrix"

If you are going to model a database, then model a field first. Then model
a row as a list of fields. Then model a table as a list of rows. That way,
row operations are fast. Column operations will be a bit tedious, but not
atrocious.
 

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

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,534
Members
45,007
Latest member
obedient dusk

Latest Threads

Top