Guest User

Untitled

a guest
Feb 21st, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1.  
  2.  
  3. int LCS_duzina( char arr1[], char arr2[])
  4. {
  5. for( int i=0; i< strlen(arr1); ++i){
  6. for( int j=0; j< strlen(arr2); ++j){
  7.  
  8. if( arr1[i] == arr2[j]){ dp[i][j]= dp[i-1][j-1] + 1; }
  9. else{ dp[i][j]= max( dp[i][j-1], dp[i-1][j] ); }
  10. }
  11. }
  12. return dp[ strlen(arr1)-1 ] [ strlen(arr2)-1 ];
  13.  
  14.  
  15. }
Add Comment
Please, Sign In to add comment