home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!moe.ksu.ksu.edu!kuhub.cc.ukans.edu!nrlvx1.nrl.navy.mil!powalisz
- Newsgroups: comp.lang.c
- Subject: Sparse arrays..ARGH!
- Message-ID: <1992Dec22.120553.893@nrlvx1.nrl.navy.mil>
- From: powalisz@nrlvx1.nrl.navy.mil
- Date: 22 Dec 92 12:05:53 -0400
- Organization: NRL SPACE SYSTEMS DIVISION
- Lines: 24
-
- I have a question about Sparse Arrays:
-
- If the array elements are declared as structs:
-
- struct sparse{
- int col;
- int row;
- int val;
- struct sparse *nextcol;
- struct sparse *nextrow;
- }
-
- how can I return 'val' recursively and return 0 if there is no element at that
- row and column. The function prototype desired is:
-
- retreive(struct sparse *a, int *col, int * row)
-
- Yes, this was part of a question I had on afinal exam, and I was wondering what
- the solution was, since I know I didn't have the correct one.
-
- Please respond via this newsgroup to give other users the knowledge, too.
-
- Ron Powalisz
-
-