Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Apr 26th, 2012  |  syntax: None  |  size: 0.20 KB  |  hits: 16  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. void LCS(int i,int j,char *x,int **b)
  2. {
  3. if (i ==0 || j==0) return;
  4. if (b[i][j]== 1)
  5. {
  6.         LCS(i-1,j-1,x,b);
  7.         cout<<x[i];
  8. }
  9. else if (b[i][j]== 2) LCS(i-1,j,x,b);
  10. else LCS(i,j-1,x,b);
  11. }