Interesting question.. I don't think there's a way. Never heard of doing that for a high-level language- I can't think of a way to know how "unsorted" it is without iterating over the array every time.
The best I can think of would be to create a custom IComparer and use it for your comparisons, so you could log every time a comparison is made and thereby approximate progress.
A count routine. Counting instances within text files and storing them in arrays, sorting the array and then comparing the records of the sorted array and writing out the results to a report file. Here is what the report looks like. I did it this way in VB6 because it did not have sorted container like other programming languages.
4/12/2005 2:26:05 PM
COUNT % OF FILE
---------------------------------------------------------------------------------------------------------
2031166 100.00% RESIDENT
---------------------------------------------------------------------------------------------------------
1 <-----TOTAL # OF OCCURENCES
2031166 <-----TOTAL # OF RECORDS
VBCounts v1.0
FIELD SUMMARY
INPUT FILE---------------> C:\767203TEST
REPORT FILE--------------> C:\767203TEST.TXT
COUNT FIELD 1------------> 0001 for 50
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.