Results 1 to 3 of 3
  1. #1
    j919 is offline Member
    Join Date
    Feb 2011
    Posts
    1
    Rep Power
    0

    Default Spreadsheet data - linked list or hashmap

    Hi,

    I am looking to implement a spreadsheet in java. Would it be better to use a linked list (rows) of linked list of cells (columns) to store the data or a hashmap (each cell maps to a key e.g. A1 -> 1, A2-> 2 etc.)?

    Or is there an even better data structure to use?

    Thanks!

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

    Default

    Cross-posting the same question in different forum on the net without notifying others is not appreciated and will quickly label you as someone many won't want to help. Please do the right thing and notify all cross-posts about the others.

  3. #3
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,529
    Blog Entries
    7
    Rep Power
    20

    Default

    On top of that: neither of those data structures are naive when it comes to cycle detection during the evaluation of your sheet; e.g.

    A1 = A2+1
    A2 = A1+1

    Excel can detect those cycles but it abrubtly stops the evaluation of the entire sheet (which I find extremely stupid). Simple lists or hash maps are just too simple data structures to think about, better use a dependency graph (which has to be a DAG if you don't like cycles in the sheet).

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

Similar Threads

  1. Storing Mutiple Classes/Data Types in a Linked List
    By Chronoattica in forum New To Java
    Replies: 7
    Last Post: 12-28-2010, 10:03 PM
  2. Replies: 1
    Last Post: 12-03-2009, 07:03 AM
  3. List API's that stores Spreadsheet using java
    By britto_bics in forum AWT / Swing
    Replies: 1
    Last Post: 11-18-2009, 03:10 AM
  4. Replies: 0
    Last Post: 03-31-2009, 04:52 PM
  5. Doubly-linked list with data structure
    By Java Tip in forum java.lang
    Replies: 0
    Last Post: 04-16-2008, 10:30 PM

Posting Permissions

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