Jump to content

Wikipedia:Sandbox: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
No edit summary
No edit summary
Line 1: Line 1:
{{Sandbox heading}} <!-- Please leave this line alone! -->
{{Sandbox heading}} <!-- Please leave this line alone! -->
This is an external link to '''[[Royal_British_Society_of_Sculptors|POOLE HARBOUR]]'''
This is an external link to '''[[Royal_British_Society_of_Sculptors|POOLE HARBOUR]]'''

1 lcs(<math>S_1</math>,<math>S_2</math>,i,j)
2 if i < 0 or j < 0
3 return 0
4
5 if <math>M_{i,j} = nil</math>
6 if <math>S_{1_i} = S_{2_j}</math>
7 <math>M_{i,j} \gets 1+lcs(S_1,S_2,i-1,j-1)</math>
8 else
9 <math>M_{i,j} \gets max\{lcs(S_1,S_2,i,j-1),lcs(S_1,S_2,i-1,j)\}</math>
10
11 return <math>M_{i,j}</math>

Revision as of 21:44, 12 December 2011

This is an external link to POOLE HARBOUR

 1 lcs(,,i,j)
 2     if i < 0 or j < 0
 3         return 0
 4     
 5     if 
 6         if 
 7              
 8         else
 9             
10
11     return