Question: Java: How to store a text file of a matrix into a singly or doubly linked list without any arrays, vectors, list, collections, etc? I
Java: How to store a text file of a matrix into a singly or doubly linked list without any arrays, vectors, list, collections, etc?
I need to read two an input files. Example:
Matrix 1:
11 17 20 13 1 8 6 7 20 1 10 18 15 10 6 12 11 3 10 6 7 20 8 8 11
Matrix 2:
12 3 5 19 13 11 4 15 6 17 14 8 17 11 18 4 4 16 12 19 5 12 12 14 1
The purpose of reading them into liked lists is to perform math operations, such as addition, subtracton, etc. on the two matrices. I'm confused on how linked lists work for matrices. Do need to detect when there is a newline " " at the the end of each row? Can linked lists be nested? If so, is it useful in this situation?
Providing code that actually works would be most beneficial to me (I like to debug and step through the process of the code to fully understand). I mainly need to know how to read matrices of various sizes into linked lists, but inlcuding at least one mathmaticial operation would be helpful too.
Also, the text files can only be read once, so no going back to the text file for anything else. That is why I need to store the matrices into linked lists.
Thanks in advance.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
