Question 36
How many total distinct parenthesizations exist for a matrix chain product of n matrices?
The number of ways to parenthesize a product of n matrices is given by the (n-1)-th Catalan number.
How many total distinct parenthesizations exist for a matrix chain product of n matrices?
The number of ways to parenthesize a product of n matrices is given by the (n-1)-th Catalan number.
In Longest Common Subsequence DP recurrence, if X[i-1] == Y[j-1], what is L[i][j]?
When characters match, they extend the LCS of prefixes X[0..i-2] and Y[0..j-2] by 1.
In Longest Common Subsequence DP recurrence, if X[i-1] != Y[j-1], what is L[i][j]?
When characters mismatch, we take the maximum of excluding X[i-1] or excluding Y[j-1].
What is the length of the LCS of strings X = 'AGGTAB' and Y = 'GXTXAYB'?
The LCS is 'GTAB' with length 4.
In Edit Distance (Levenshtein), what are the three allowed character operations?
Levenshtein distance allows Insertion, Deletion, and Substitution (Replacement) of a character.