I have to use a thousands of data read off from a file, and use the data hundreds of times repetitively in order to train and test my AI algorthm. Right now, I have two possible solutions. One is to keep reading off directly from the file everytime I need to use the thousands of data. The other one is to read off from the file and store the data into an ArrayList, and then repetitively use the arraylist by looping through it. Which way is faster? If possible, could someone also provide me with the big o notation for each of the two methods? Also, could there be a completely new way of approaching this problem that can reduce the time it takes to read the over-flooding amount of data?
Thanks, Hee