Thread: double matrix and data structure?

  1. #1
    Registered User
    Join Date
    Oct 2001
    Posts
    17

    double matrix and data structure?

    a program that stores and processes sparse matrices of floating point numbers. The matrices are of a fixed xize(1,000x1,000 elements), but only a small percentage of the elements have non-zero values. Suggest a method for storing the matrices that is more economical with memory than a two-dimensional array of 1,000x1,000 floats. Write C definitions for your suggested data structure(s).


    I use linkedlist to do it.

    struct matrix {
    int row;
    int coloum;
    struct node *next;

    } node;

    is it right? then how to do it?

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,660
    In the absense of more information, its as good as any other method.

    There are no correct answers - any number of solutions are possible. All will have advantages and disadvantages, and as you gain experience, you will be able to make better choices.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Matrix Multiplication ( Accessing data from a file ) HELP
    By six_degreez in forum C Programming
    Replies: 2
    Last Post: 07-24-2008, 05:21 PM
  2. Matrix Help
    By HelpmeMark in forum C++ Programming
    Replies: 27
    Last Post: 03-06-2008, 05:57 PM
  3. Replies: 3
    Last Post: 02-26-2008, 02:12 PM
  4. matrix class
    By shuo in forum C++ Programming
    Replies: 2
    Last Post: 07-13-2007, 01:03 AM
  5. Trying to make this code faster & Cramer
    By just2peachy in forum C++ Programming
    Replies: 3
    Last Post: 12-03-2004, 10:54 AM