Table data structure in C ?

Discussion in 'C Programming' started by Richard, Jul 4, 2003.

  1. Richard

    Richard Guest

    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.
    Richard, Jul 4, 2003
    1. Advertisements

  2. Richard

    Dann Corbit Guest

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

    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
    Dann Corbit, Jul 4, 2003
    1. Advertisements

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 (here). After that, you can post your question and our members will help you out.
Similar Threads
There are no similar threads yet.