"Richard" <> wrote in message
news:MPG.196ec04c224c22eb989b43@199.45.49.11...
>
> 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 news:comp.programming
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.
--
C-FAQ:
http://www.eskimo.com/~scs/C-faq/top.html
"The C-FAQ Book" ISBN 0-201-84519-9
C.A.P. FAQ:
ftp://cap.connx.com/pub/Chess%20Anal...ject%20FAQ.htm