Bookmark Topic Watch Topic
  • New Topic

Which data structure and arithmetic should I choose?  RSS feed

 
henven
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Report post to moderator
I have a large set of millions of items,
Which data structure and arithmetic should I use for just search ?

Someone tell me that hashmap and treemap in jdk1.4 are useful and convenient just for small sets of items ( < 1000 ).
 
Tim West
Ranch Hand
Posts: 539
  • Mark post as helpful
  • send pies
  • Report post to moderator
The short story is that it depends heavily on this sort of thing:

  • How will you access the data? Sequentially? Random-access? Does it need to be sorted?
  • How often does it change? Relative number of inserts/deletes/moves?
  • How big is the overall data structure, vs. your current memory availability? You may need some ability to write part of the structure to persistent storage to free-up RAM if it's too big.


  • That's all I can think of question-wise, but there are probably others.

    So, when we have answers we can maybe offer advice :-)


    --Tim
     
    Jessica Sant
    Sheriff
    Posts: 4313
    Android IntelliJ IDE Java
    • Mark post as helpful
    • send pies
    • Report post to moderator
    "henven"-
    Posting the same thread in multiple forums is not the right way of getting your question answered..... It makes a conversation difficult to follow and wastes people's time when its already been answered somewhere else.

    I'm closing this thread. Please continue the conversation here, in the intermediate forum.

    Also, can you please change your display name to match the naming policy? Basically you should have a not obviously fictious first AND last name. You can change it here.

    Thanks!
     
      Bookmark Topic Watch Topic
    • New Topic
    Boost this thread!