Re: pattern equality test?

From: Michael Mendelsohn (keine.Werbung.1300_at_michael.mendelsohn.de)
Date: 03/19/04


Date: Fri, 19 Mar 2004 01:25:29 +0100


"Arthur J. O'Dwyer" schrieb:
> > Just a note: make sure the matches in your steps 1. and 2. are both
> > matched both ways each time.
> > Example (from my post): "ab*xyz" and "abc*yz" match because "ab*"
> > matches "abc*" and "*yz" matches "*xyz" (even though "*xyz does not
> > match "*yz").
>
> Uh-huh. I wasn't thinking in terms of regex matching with the
> [pre|suf]fixes. I considered "abc" and "ab" (note lack of asterisks)
> to "match prefix-wise" because they were the same up to the length of
> the smaller; likewise, "yz" and "xyz" match suffix-wise.

Ah, ok. Thanks for the clarification.

> I was going to post code, but when I started writing the code was
> when I found the bugs in my algorithm. And now that I've clarified
> the algorithm, the code is trivial enough to make it not worth my
> while. ;-)

Personally, I like explanations of algorithms better than unexplained
code (which is likely not what you intended to do, but I've been
thinking about this, and you gave me the opportunity to say it). I
realize this is not comp.explanations, but rather comp.programming, but
after all it's supposed to be neither language nor OS-specific, and some
C code that gets posted is pretty language specific (using array index
-1, for example)...

Michael

-- 
Feel the stare of my burning hamster and stop smoking!


Relevant Pages

  • P Versus NP
    ... determine whether every language accepted by some nondeterministic ... algorithm in polynomial time is also accepted by some ... L = Lfor some Turing machine M which runs in polynomial time} The ... We say that R is polynomial-time iff L R ...
    (sci.math)
  • Re: Mr. P and Ms. S
    ... determine whether every language accepted by some nondeterministic ... algorithm in polynomial time is also accepted by some ... L = Lfor some Turing machine M which runs in polynomial time} The ... We say that R is polynomial-time iff L R ...
    (sci.math)
  • Re: pseudo code v/s algorithm
    ... insert your language here) than code. ... There is absolutely no difference between algorithm and code, ... If I have an implementation or pseudo-code it cannot be ... Turing Machine or lambda-calculus in it, modulo the infinite memory ...
    (comp.programming)
  • Re: pseudo code v/s algorithm
    ... insert your language here) than code. ... There is absolutely no difference between algorithm and code, ... If I have an implementation or pseudo-code it cannot be ... just have a look at the sources of some Common Lisp ...
    (comp.programming)
  • Re: pseudo code v/s algorithm
    ... Algorithm is like a thought. ... insert your language here) than code. ... Pseudo-code is just an informal way to express such a mathematical ... Turing Machine or lambda-calculus in it, modulo the infinite memory ...
    (comp.programming)