MCQs
The program prints the 8th Catalan number, which is 429.
The space complexity of the above dynamic programming implementation of the balanced partition problem is O(sum * n).
The following lines should be added:
False[row][col] += False[row][pos] * False[pos+1][col];
True[row][col] += t_row_pos * t_pos_col + False[row][pos] * False[pos+1][col];
Memoization is the technique in which previously calculated values are stored, so that, these values can be used to solve other subproblems.
Since there are 10 dice and the minimum value each die can take is 1, the minimum possible sum is 10. Hence, a sum of 4 cannot be achieved.
The empty string can be transformed into "abcd by inserting "a, "b, "c and "d at appropriate positions. Thus, the edit distance is 4.
The lines, prevFib = curFib and curFib = nextFib, make the code complete.
The naive method prints the maximum sub-array sum, which is 7.
The complete matrix represents the maximum sum rectangle and it's sum is 14.
The program prints the value of maximum sub-array sum, which is 37.