A little calculation on the modification search: Let the charset size to be m. Let the input string have size n. Let C(x, y) be the count of different strings that can be obtained by the following four operations on a string of size x, and use y levels of search. insert: (n+1)*m options delete: n substitution: n*m switch: n-1 C(n, 1) = (n+1)*m + n + n*m + n-1 = (m + 1)(2n + 1) - 2 =~ 2*m*n So if m = 30, n = 10, C(n, 1) = 31 * 21 - 2 = 649 Or C(n, 1) =~ 2 * 30 * 10 = 600 Now consider all combinations of two levels of search: C(n, 2) = (n+1)*m*C(n+1, 1) + n * C(n-1, 1) + n*m*C(n, 1) + (n-1)*C(n, 1) =~ 4 * m^2 * n^2 + 4 * n^2 * m So for n = 10, m = 30, C(n, 2) =~ 400,000 But for insert result we don't have to do delete, for deleted result we don't have to do insert, so that will eliminate some combinations. But that's for the 4 * n^2 * m component. The biggest component is substitution for inserted result, or insertion for substituted result. This is O(m^2 * n^2).