in reply to Re^2: True Brute Force Longest Common Sub Sequence
in thread True Brute Force Longest Common Sub Sequence

No, it cannot.

"Sequence" means that you cannot skip characters in your string. Otherwise it would just be permutations and not sequences.

See BrowserUK's comments hereafter.

CountZero

A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James

  • Comment on Re^3: True Brute Force Longest Common Sub Sequence

Replies are listed 'Best First'.
Re^4: True Brute Force Longest Common Sub Sequence
by BrowserUk (Patriarch) on Nov 25, 2007 at 11:04 UTC
    "Sequence" means that you cannot skip characters in your string.

    What you are describing would be a contiguous sequence. Otherwise known as a 'substring'. Skipping characters is permitted, it is their relative positions that makes it a sequence.

    Contrast LC subsequence with LC substring.

    For the subsequence problem, the characters in the solution must

    • appear in both strings. (common)
    • appear in the same relative ordering in both strings and the solution. (sequence).
    • Be longer than any other set of characters that complies with the above two conditions. (longest)

    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.
      Thank you!

      Not a day passes or we learn new things in our Monastery.

      CountZero

      A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James