file based merge sort on large datasets in Java
given large datasets that don't fit in memory, is there any library or api to perform sort in Java? the implementation would possibly be similar to linux utility sort. Java provides a general-purpose sorting routine which can be used as part of the larger solution to your problem. A common approach to sort data that's too large to all fit in memory is this: 1) Read as much data as will fit into main memory, let's say it's 1 Gb 2) Quicksort that 1 Gb (here's where you'd use Java's built-in sort from the Collections framework) 3) Write that sorted 1 Gb to disk as "chunk-1" 4) Repeat steps 1-3