I have huge table data with 150 rows and 10 Columns, each column has String data. After storing the data, I have to traverse as well to find a particular value. So, I am looking for answers to the best data structure in this case in terms of performance, flexibility of traversing.
I have thought of Array, ArrayList, Hashmap.
Also, I have found similar questions on SO but they don't answer my question.
EDIT: The data is a mixture of Alphabets and Integers. Cannot be sorted and contains duplicates as well.
It seems then for such table size combination 2D Array[][] + Hashmap
would be an excellent choice. Simple and effective.
Array contains values and allows to traverse the table in any order.
HashMap contains pairs <String; TPoint>
(coordinates in array - Row/Col pair).
If you need only to know whether the table contains some string, then don't store coordinates in Map.
I think that Guava Table
proposed by @krzyk, provides similar functionality (don't know about performance)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With