Results 1 to 2 of 2
Thread: Help Testing My Homework Code
- 03-01-2011, 07:21 AM #1
Help Testing My Homework Code
I have the following homework assignment:
Implement a matrix abstract data type which doesnt allocate memory for 0 values. This is useful for sparse matrices, where many of the values in the matrix are zero. Use linked lists to implement the matrix class.
I made a very crude test case to test my solution: Basically I need for there to be a file called "file.txt" at the root level of your C: drive and the file will look like this:
0 0 0 9
1 0 0 0
2 0 0 0
1 0 0 0
basically representing a sparse matrix. Per the assignment, we were supposed to iimplement a LinkedList for our MatrixClass, so I tried to do that (hopefully). So when you run my program, it will ask you to input 2 numbers. You can put in any 2 (from 0 to 4) but the idea is that you are going to get back the node value of an element in my LinkedArrayList. So for instance, in the example above, if we wanted to get the 9 value sent to us, when you run my program, put in '1 1', as we want the first linked list, and the 9 is going to be the first value (node) in the linked list because everything preceding it in its row is 0. If we wanted the 2, you put in '3 1', etc. I just want to see if I could get some opinions on if I'm taking the right approach.
Last edited by sehudson; 03-01-2011 at 07:24 AM.
- 03-01-2011, 07:23 AM #2
- By Alexander_003 in forum New To JavaReplies: 2Last Post: 11-27-2010, 12:09 AM
- By phams in forum New To JavaReplies: 3Last Post: 06-16-2010, 04:02 AM
- By phams in forum Sun Java Wireless ToolkitReplies: 0Last Post: 06-15-2010, 11:33 AM
- By keynan in forum EclipseReplies: 0Last Post: 02-14-2008, 11:35 PM