Results 1 to 5 of 5
Thread: Spreadsheet in Java
- 10-03-2008, 03:43 AM #1Senior Member
- Join Date
- Sep 2008
- Rep Power
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.
- 10-03-2008, 07:57 AM #2
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.
Last edited by fishtoprecords; 10-03-2008 at 08:13 AM. Reason: fix typo
- You need a scarce matrix
- 10-03-2008, 08:14 AM #4