Largest Rectangle in Histogram

探讨在给定直方图中寻找最大矩形面积的问题。假设所有条形宽度相同且为1单位,目标是最优地组合连续条形形成最大面积矩形。文章提供了几个参考资料链接,涵盖了解决该问题的不同方法。

Find the largest rectangular area possible in a given histogram where the largest rectangle can be made of a number of contiguous bars. For simplicity, assume that all bars have same width and the width is 1 unit.

For example, consider the following histogram with 7 bars of heights {6, 2, 5, 4, 5, 2, 6}. The largest possible rectangle possible is 12 (see the below figure, the max area rectangle is highlighted in red)

histogram


关于本题,还没有刷到,只是在一个视频中提及此问题。思路很巧妙,暂时将解题思路和参考的资料,贴在这里,后期再做完善

参考资料:

http://www.geeksforgeeks.org/largest-rectangle-under-histogram/

http://www.cnblogs.com/felixfang/p/3620086.html

http://www.cnblogs.com/felixfang/p/3676193.html

http://chuansong.me/n/400873436742

http://blog.youkuaiyun.com/yutianzuijin/article/details/52072427

评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值