Do NOT write pseudocode when describing your dynamic programs. Rather give the Bellman Equation, describe the matrix, it
Posted: Wed Mar 30, 2022 9:21 am
2. Consider the following problem: you are provided with a two dimensional matrix, M, (dimensions, say, mx n). Each entry of the matrix is either a 1 or a 0. You are tasked with finding the total number of square sub-matrices of M with all 1s. Give an O(mn) algorithm to arrive at this total count. Furthermore, how would you count the total number of square sub-matrices of M with all Os?