On Mon, 21 Jul 2008 19:49:34 -0400
"Rod Pemberton" <do_not_have@[EMAIL PROTECTED]
> wrote:
> But, my preliminary thought is that the using the remainder of one
> stage for the shorter string in the next stage is a problem, i.e., it
> will still exceed array boundary conditions on the next shorter
> string.
Perhaps a specific example will help you see why this cannot happen.
Consider the base string ABCDE, for which there are 120 permutations.
Without actually enumerating them, we know that the nature of the
generating function ensures that the final permutation will be EDCBA,
which we will use as out test case. We then step through the algorithm,
with the following results:
Pn Divisor Index Remainder String[Index]
119 24 4 23 E
23 6 3 5 D
5 2 2 1 C
1 * 1 * B
0 * 0 * A
Any questions?
--
Chuck
http://www.pacificsites.com/~ccrayne/charles.html


|