Results 1 to 5 of 5
  1. #1
    emceenugget is offline Senior Member
    Join Date
    Sep 2008
    Posts
    564
    Rep Power
    6

    Default 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.

  2. #2
    fishtoprecords's Avatar
    fishtoprecords is offline Senior Member
    Join Date
    Jun 2008
    Posts
    571
    Rep Power
    6

    Default

    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 07:13 AM. Reason: fix typo

  3. #3
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    25

    Default

    You need a scarce matrix
    Is that the same as a sparse matrix?

    thanks, Pete

  4. #4
    fishtoprecords's Avatar
    fishtoprecords is offline Senior Member
    Join Date
    Jun 2008
    Posts
    571
    Rep Power
    6

    Default

    Quote Originally Posted by Fubarable View Post
    Is that the same as a sparse matrix?
    Better, because of its unique and creative spelling.

  5. #5
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    25

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •