Created
May 16, 2018 04:56
-
-
Save asela38/2655c13981ef35dfad9d8c5724a18864 to your computer and use it in GitHub Desktop.
Generate basic statistics for 1 Billion data set of Integers
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.BufferedReader; | |
import java.io.FileInputStream; | |
import java.io.IOException; | |
import java.io.InputStreamReader; | |
class OneBillionIntegerStatistics { | |
public static void main(String[] args) throws IOException { | |
try (BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream("numbers_1B.in")))) { | |
System.out.print(reader.lines().mapToLong(Long::valueOf).summaryStatistics()); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment