[ create a new paste ] login | about

Link: http://codepad.org/jl3xg8R3    [ raw code | output | fork ]

C++, pasted on Apr 9:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
    void lcs(const T* x,int i,const T* y,int j,                                 
                const int*const* tbl) {                                         
        if (i > 0 && j > 0) {                                                   
            if (x[i-1] == y[j-1]) {                                             
                lcs(x, i-1, y, j-1, tbl);                                       
                cout << x[i-1] << " ";                                          
            }                                                                   
            else {                                                              
                if (tbl[i][j-1] > tbl[i-1][j])                                  
                    lcs(x, i, y, j-1, tbl);                                     
                else                                                            
                    lcs(x, i-1, y, j, tbl);                                     
            }                                                                   
        }                                                                       
    }


Output:
1
2
Line 1: error: expected ',' or '...' before '*' token
compilation terminated due to -Wfatal-errors.


Create a new paste based on this one


Comments: