performance - Finding max record with java -
i have problem statement , know best way of solving in java.
i have large number of records(1 million say) records have timestamp , value. have output in span of each 15 min highest value.
e.g. timestamp -07-10-2013 10.15 - 14 -07-10-2013 10.18 - 13 -07-10-2013 10.19 - 18 -07-10-2013 10.30 - 16 -07-10-2013 10.34 - 10 -07-10-2013 10.38 - 17 -07-10-2013 10.42 - 30 -07-10-2013 10.54 - 23 -07-10-2013 10.57 - 44
output
-07-10-2013 10.19 - 18 -07-10-2013 10.42 - 30 -07-10-2013 10.57 - 44
what best way of doing in java. iterating through each record looks tedious thing. great.
you can't max value without iteration through each value, unless have kind of predefined order, can use optimization.
i use map accumulate highest value, comparing stored, way can highest value in 1 iteration through records.
Comments
Post a Comment