in reply to Inefficient code?

Pretty much, for each array you have, you are running through each array 4 times; once to read in, once for mean, once for max, and once for min. While these are all O(n) times, as n grows, so will the time to execute this program.

You should be able to build up the necessary maths for mean, max, and min at the same time you read in the data. You'll need some variables to do this (I'd suggest a hash for each data type you are reading in). And, if you do this right, you need not even store the data, just process the numbers for the current line and drop them, helping you to save memory.


Dr. Michael K. Neylon - mneylon-pm@masemware.com || "You've left the lens cap of your mind on again, Pinky" - The Brain