algorithm for comparing files

hi
i have 1000 files, i need to compare files with one another,
can some help with logic with to decrease the no of comparings

thanks
Satya

what sort of comparison are you after.

do yo need to verify contents of files or sizes, or some other form of compare ?

what sort of size/content are your files ?

do you need to compare every file against every other file, or is there some sort of sequence ?