Saturday, April 26, 2014

Edit distance variations

1. Longest subsequence of A and of B
    Let the E(A,B) be 1. when A[i] = B[j] , 1+previous distance
                                2. when A[i]!=B[j] ,  0
  and the biggest one in the matrix, or record the maximum in one array D, is the longest subsequence.

2. Minimum number of characters need to delete to make A a palindrome
   Put all A's character in reverse order,  and get the min distance, then this distance is to make A a palindrome.


3. Given a string A and a regular expression, what is the string in the regular expression r that is closesst to A?

Need to change the comparing function stores in the matrix to regular expression

No comments:

Post a Comment