arrays - 在给定的 0's and 1' s 方阵中寻找 1 的最大方子矩阵?

标签 arrays algorithm

以下是面试问题:

Write a function that outputs the size of the largest square submatrix consisting solely of ones in a square matrix of ones and zeros.

示例 1:

0 1
0 0

输出:1

示例 2:

0 0 0
0 1 1
0 1 1

输出:2

示例 3:

1 1 1
1 1 1
1 1 1

输出 3

我希望尽可能有效地解决这个问题。

最佳答案

使用Search然后 Dynamic Programming .

关于arrays - 在给定的 0's and 1' s 方阵中寻找 1 的最大方子矩阵?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4395063/

相关文章:

algorithm - 哈希问题的 Perl 哈希

c - 在数组中查找总和最接近或等于给定数字的 5 个元素

c++ - 创建多阵列的任意 View

c++ - 有没有一种简单的方法可以在初始化后填充二维数组?

c - 插入成绩和 GPA 不适用于学生

c++ - 生成两个随机数,使一个总是大于另一个

java - 随机生成约束边以生成约束 delaunay 三角剖分

algorithm - 处理间隔的数据结构

c - 分析C程序的内存使用情况

C语言isMagicsquare函数: What logic error is in my function code?