Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

修复 数组名称错误 #470

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions ebook/zh/02.04.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
```c
int MaxSubArray(int* A, int n)
{
int maxSum = a[0]; //全负情况,返回最大负数
int maxSum = A[0]; //全负情况,返回最大负数
int currSum = 0;
for (int i = 0; i < n; i++)
{
Expand Down Expand Up @@ -84,7 +84,7 @@ int MaxSubArray(int* a, int n)

## 举一反三
1 给定整型数组,其中每个元素表示木板的高度,木板的宽度都相同,求这些木板拼出的最大矩形的面积。并分析时间复杂度。

此题类似leetcode里面关于连通器的题,需要明确的是高度可能为0,长度最长的矩形并不一定是最大矩形,还需要考虑高度很高,但长度较短的矩形。如[5,4,3,2,4,5,0,7,8,4,6]中最大矩形的高度是[7,8,4,6]组成的矩形,面积为16。

2、环面上的最大子矩形
Expand Down