I’m writing a program that tests a generated string against a given string to see if they match, without knowing the string or it’s length. The input string cannot be manipulated either. My process so far is the brute force method of generating permutations of character sets:
Permute ‘abc…xyz’ for length(1+)
Until the strings match.
However, I’m wondering if it would be better or faster to generate the permutations, save them to a file, then read the lines from the file during the matching? And of course, generating the file beforehand.
Probability not, because in that case you would be disk IO bound, but small part of your generated code would run from cache. Code need like at most approx 10 operations to generate new permutation and is way faster than reading from disk