Shortest Common Supersequence | A Naive recursive javascript program to find length of the shortest supersequence ; Driver code
function superSeq ( X , Y , m , n ) { if ( m == 0 ) return n ; if ( n == 0 ) return m ; if ( X . charAt ( m - 1 ) == Y . charAt ( n - 1 ) ) return 1 + superSeq ( X , Y , m - 1 , n - 1 ) ; return 1 + Math . min ( superSeq ( X , Y , m - 1 , n ) , superSeq ( X , Y , m , n - 1 ) ) ; } var X = " " ; var Y = " " ; document . write ( " " + " " + superSeq ( X , Y , X . length , Y . length ) ) ;