where are those " 10 billion 整数" stored ?
let assuming a file there are 10 billion 整数, represented as array:
int Source[10,000,000,000]; where source[i] is the integer value in i location,
the destination file is represented as int Destination[10,000,000,000] initialized as 0 ;
here is the sort, you might call hash algorithm with a counter to address the conflict
for( i=0;i<10,000,000,000;i++)
Destination[Source[i]] ++;
the key : the maximum value of a integer(32 bits) is less than 10,000,000,000;
am i right?
let assuming a file there are 10 billion 整数, represented as array:
int Source[10,000,000,000]; where source[i] is the integer value in i location,
the destination file is represented as int Destination[10,000,000,000] initialized as 0 ;
here is the sort, you might call hash algorithm with a counter to address the conflict
for( i=0;i<10,000,000,000;i++)
Destination[Source[i]] ++;
the key : the maximum value of a integer(32 bits) is less than 10,000,000,000;
am i right?