Reputation: 21
I have an assignment where I need to talk about and compare different data structures suited for storing some spreadsheet data.
They don't have to be the most optimal ways of storing the data as the actual assignment is to compare those that I choose to use. One of the three I need is using a Hash Table, and another is using a simple list. But I can't seem to come up with a good third option to use for this assignment which is why I'm asking you for a "somewhat optimal" data structure to use for a spreadsheet. Also what the different complexities of said data structure might be as well.
Please do mark as duplicate if there is another thread on this, I couldn't find anything good, we can't always be pros at using the search feature.
Upvotes: 1
Views: 532
Reputation: 116
How about an array? Since the data is in a table format, you can easily calculate the index of each row. plus making row-calculations is relatively simple.
The major downside is that you need a large continuous block of free memory, and allocating more memory is expensive.
Another fun thing you can do is store it in an array of columns instead of rows. It makes column operations much faster (think of caching).
Upvotes: 0