@Modeling Expert: Can you please explain your algo with an example...
especially calculating the area of rectangles using min depth and its
traversal through the matrix...
On Tue, Oct 5, 2010 at 7:24 PM, Modeling Expert cs.modelingexp...@gmail.com
wrote:
For square matrix , link suggested by
For square matrix , link suggested by Amit would work. Finding a sub-
rectangle is tougher.
I would go this way; First scan from bottom right till top left and
for every Non-zero member in matrix create this pair ( width ,
depth ).
Width is how many continuous 1's ( including itself ) are there
Traverse the matrix in z-order, or hilbert-order. This is a heuristic-
algo.
On Oct 4, 1:51 pm, mac adobe macatad...@gmail.com wrote:
Given a binary matrix, find out the maximum size square sub-matrix with all
1s.
For example, consider the below binary matrix.
0 1 1 0 1
1 1 0
@chi .. can you please share what is this and how it resolves the issue at
hand ?
regards
--mac
On Mon, Oct 4, 2010 at 5:50 PM, Chi c...@linuxdna.com wrote:
Traverse the matrix in z-order, or hilbert-order. This is a heuristic-
algo.
On Oct 4, 1:51 pm, mac adobe macatad...@gmail.com wrote:
Maybe you meant this: Multidimensional Range Search in Dynamically
Balanced Trees.
http://www.vision-tools.com/h-tropf/multidimensionalrangequery.pdf
There is surely a better way, but a Z-Curve traversal is like a
quadtree, or spatial index of 2-dimensional data, or binary matrix.
You can
Here is the complete program ..
First create a square matrix Y for which
Y[i][j] represents number of contiguous 1's till row i in the column j of
matrix A ,which is the source matrix.
Now let i and j be two levels at which our matrix of maximum size is
contained.For each column of the matrix