Answer the question
In order to leave comments, you need to log in
How to make it faster?
I have an Array of 500 entries, and the file contains 1,000,000 such entries.
I don't need to insert duplicates into the file.
I can read all the entries from the file into the HashSet and if there are those in the array that are already in the Set, remove them from the array and insert the rest into the file.
Or I can check each element of the array directly in the file, and remove duplicates.
What should be faster?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question