brute force example for LCS

Revision 2 vs. Revision 3

Legend:

Unmodified
Added
Removed
  • Description

    r2 r3  
    1 In this particular example the number of loops is output along with the value of O(n*m).  This algorithm is less than perfect. 
     1In this particular example the number of loops is output along with the value of O(n*m).  This algorithm is less than perfect; but as far as I can tell, does the job of finding the LCS. 
  • Code

    r2 r3  
    1111        << "First we proceed by going through X compared to Y and then " 
    1212        "going through comparing Y to X.  In either case we get 'a' not 'the' " 
    1313        "longest subsequence." << std::endl << std::endl; 
    1414        std::vector<std::string> vs; 
    1515        std::string x="ABCDBAGZCDCA"; 
    16         //std::string y="BCADCGZ"; 
    17         std::string y="bcadcgz"; 
     16        std::string y="BCADCGZ"; 
     17        //std::string y="bcadcgz"; 
    1818        //std::string x="ABCDE"; 
    1919        //std::string y="abcde"; 
    2020        size_t n=x.size(); 
    2121        size_t m=y.size(); 
    2222        size_t i(0), j(0), ii(0), jj(0);