Algorithm or pseudo code sought for getting the latest last modified time..

Hi I need to write a program in java that lists the latest last modified time among the files in folders and its subfolder and also gets the size of the folder. In my case, average folder size is 9 GB.Could you please suggest any algorithm to achieve this? I tried to implement it by gathering last modified times from folders and its subfolders recursively and storing the info in Vector and finally

getting the max of the last modified times but it was horribly slow and memory hogging.

[510 byte] By [ravishakyaa] at [2007-10-3 4:58:29]
# 1

Remove the part that stores the data in a Vector. You don't need to store any data to add up a series of numbers. And you don't need to store any data to find the largest of a series of numbers either. Just scan the directory recursively as you are already doing and keep track of the sum of the sizes and the max of the last-modified dates.

DrClapa at 2007-7-14 23:03:51 > top of Java-index,Other Topics,Algorithms...