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
    1. Advertising

  2. Richard

    Dann Corbit Guest

    "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 Analysis Project FAQ.htm
    Dann Corbit, Jul 4, 2003
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. David Williams
    Replies:
    2
    Views:
    1,104
    Jacob Yang [MSFT]
    Aug 12, 2003
  2. Rio
    Replies:
    4
    Views:
    1,172
  3. Excluded_Middle

    Pointers to structure and array of structure.

    Excluded_Middle, Oct 24, 2004, in forum: C Programming
    Replies:
    4
    Views:
    732
    Martin Ambuhl
    Oct 26, 2004
  4. Leo Nunez
    Replies:
    3
    Views:
    1,183
    Neil Kurzman
    Feb 9, 2005
  5. A
    Replies:
    27
    Views:
    1,574
    Jorgen Grahn
    Apr 17, 2011
Loading...

Share This Page