Tags: Moderate, dynamic programming Problem description![]() Given an N-dimensional matrix of n elements of signed integer type, find the contiguous sub-matrix with the maximum sum. Simplified version: Given a 2 dimensional matrix of n elements of signed integer type, find the contiguous 2-dimensional sub-matrix with the maximum sum (see example figure). The simplified 1-dimensional array version of this problem was first posed in 1977 as a simplified model for maximum likelihood estimation of patterns in digitized images. Grading
ReferencesNorman, a fellow engineer at Adify, asked me this question during a seven hour final round interview. Maximum subarray problem. Wikipedia. http://en.wikipedia.org/wiki/Maximum_subarray_problem (accessed Feb. 2011) Improved Algorithms for the K-Maximum Subarray problem. Oxford Journals. http://comjnl.oxfordjournals.org/content/49/3/358.full (accessed Feb. 2011) |
