• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Best Collection datastructure to use for very large data

 
Ranch Hand
Posts: 192
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Ranchers
I have an application which handles millions of records. I have a requirment to handle a very large data set in java. Which is that most suitable datastructure which I can use to handle this large data effeciently. I may or may not have data in sorted order. But I can understand somehow whether data I received is sorted or not before using the container for it. Please suggest me the solution for bot the cases viz for sorted data and non sorted data.
Thanks in advance
SAmir
 
Ranch Hand
Posts: 5575
Eclipse IDE Windows XP Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
your question is still vague. there are duplicate datas ? if yes,

you can choose either ArrayList or LinkedList(if there would be more removal and insertion operation)

if there is no duplicate record,
you can use HashSet; and you can sort elements by passing HashSet into TreeSet

hth
 
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
First, you have to decide what structure the data has, and how you want to use it in your program.

For example, if it consists of records that you can lookup by some key value, then a Map will probably be a good data structure. If it's just a list of things, use a List.

Then, decide on what implementation of a Map or List you want to use. For example, ArrayList and LinkedList have different performance characteristics: an ArrayList is efficient if you need to lookup an element by index, and a LinkedList is not. On the other hand, a LinkedList is efficient if you need to insert elements in random places in the list, while and ArrayList is not. The API documentation of the different collection implementations describes these differences in detail.
 
Marshal
Posts: 79180
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sounds as though you would do well to create a database.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic