Question
Consider the following dynamic programming implementation:#include#includeint max(int a, int b){ if(a > b) return a; return b;}int min_ins(char *s){ int len = strlen(s), i, j; int arr[len + 1][len + 1]; char rev[len + 1]; strcpy(rev, s); strrev(rev); for(i = 0;i
Answer: Option C
Was this answer helpful ?
arr[len][len] contains the length of the longest palindromic subsequence. So, len “ arr[len][len] gives the minimum number of insertions required to form a palindrome.
Was this answer helpful ?
Submit Solution