Thought 1:
First, split the data into some files with a small amount of data, such as 1000000 data into one file.
Sort the data of each file (sort by quick sort)
Then, the K-path merge method is used to merge the data into a file, and the maximum 10000 data records sorted are retrieved.
Thought 2:
1. Read all the data at a time to obtain the largest and minimum values.
2. Use the maximum and minimum values, which are divided into 100 intervals. DX = (x_max-x_min)/100. -- Range of each interval: DX * (I-1) to DX * I, I = 1 to 100.
3. Read all data at a time and count the number of data falling into each interval.
4. From the maximum interval, add up the number of data in sequence and locate the interval that is exactly greater than 10 thousand.
5. If there are many numbers in this interval, you can subscribe to 100 more intervals for search. If there are not many data, read all the data at a time and queue the number of the size ranges in this interval, find the required number.
6. Read all the data at a time, and obtain the number that exceeds the upper limit of this range.
The number of data found in step 5 and Step 6 is 10 thousand.
Http://blog.csdn.net/laibinghua/article/details/5904636
Http://www.cppblog.com/85940806/archive/2011/06/02/147958.html
Select the maximum of 1 billion floating point numbers.