I have a 1GB file with random words with length 1 to 256 and I have just 2GB RAM for sorting that(if ram usage goes above 2GB the process will be killed).
What's the most efficient way to sort the words in the file in lexicographical order with C++ or java?
For example, is there a better way than a trie tree or a way to implement it more efficiently?