Spreadsheet in Java
I had a really vague question during a phone interview asking me how I would try to implement a Spreadsheet in Java such that it had infinite rows and columns.
I concluded that a 2d-array would not suffice, and the only other option I could think of was some kind of insane structure like a 2d linked list such that each node has 2 pointers in and out (from and to adjacent nodes in rows and columns).
I was wondering if anyone had a better idea than that or if there is actually a class that can handle this. Thanks.
The question is designed to make you think.
You can not have an infinite number of real rows and columns. So a trivial two dimensional array is a loser.
You need a sparse matrix, and you will need to implement it yourself.
Is that the same as a sparse matrix?
You need a scarce matrix
Better, because of its unique and creative spelling.
Originally Posted by Fubarable
lol, thanks for giving an insomniac a chuckle!