which data structure is best to choose regarding memory usage in java
i have been searching lately on google to see which data structure is efficient to use which will take less memory and will work fast with less complexity. any thoughts? i know map is the best if you have to search it faster through a key and arraylist does not have random access which means it is slow in searching. any other thoughts?
[344 byte] By [
lrngjavaa] at [2007-11-27 6:47:49]

Just to make the complex question even more complex:
You may consider one or more arrays. Rather space efficient if you fill them, and you have efficient random access.
You may consider storing your data in a relational database. There are lots of built-in searching and sorting opportunities in SQL.
First and last, I agree with what's ben said: It all depends on your situation, your requirements, frequency of insertion, types of searches and a lot more. In many situations (but possibly not yours), writing a clear and easily maintainable program is more important than space and time considerations.
Message was edited by:
OleVV
OleVVa at 2007-7-12 18:20:53 >
