[Israel.pm] sliding window on streaming lines

Gaal Yahas gaal at forum2.org
Sat Jun 5 21:36:51 PDT 2004

On Sun, Jun 06, 2004 at 07:12:42AM +0300, Shlomo Yona wrote:
> Getting all the necessary data of a window in memory is done
> pretty much as you described it last night. However, the
> real challange, I think, is attending "all possible *paths*
> of strings in a given window". 
> My current strategy is going over all possible paths using
> a DFS or BFS style algorithm. I'll post the code on the
> mailing list as soon as I'm convinced it's correct. I was
> hoping to see other approaches/implementations in order to
> get inspired to further increase the clarity of my own code.

The idea I had followed basically gives each combination a number,
whose every digit is in a different base. :-P

Modulo small details -- perhaps it needs to be zero-based instead of
one-based as in my previous mail -- I think it's pretty efficient;
and since we visit each "number" and hence each possible combination,
it is correct. Is what you mentioned similar to that? I'm not an expert
in algorithms and yet I get a feeling that there's no need for fancy
stuff here.

Gaal Yahas <gaal at forum2.org>

More information about the Perl mailing list