Largest rectangle in Histogram | Leetcode #84

Описание к видео Largest rectangle in Histogram | Leetcode #84

This lecture explains a very popular programming interview question which is to find the largest rectangle in histogram.Given an array representing heights of each bar in a histogram, we are required to find the area of the largest rectangle which can be formed from the given histogram.I have first explained the problem using some insightful examples and then i have shown the most important observation for this problem.Using this observation, I have shown an algorithm with optimization using stack which can find the largest rectangle area in the histogram in just O(N) time using just 3 traversals.I have also shown the dry run of the code along with code explanation at the end of the video.CODE LINK is present below as usual. If you find any difficulty or have any query then do COMMENT below. PLEASE help our channel by SUBSCRIBING and LIKE our video if you found it helpful...CYA :)

========================================================================
Join this channel to get access to perks:
   / @techdose4u  

INSTAGRAM :   / surya.pratap.k  

SUPPORT OUR WORK:   / techdose  

LinkedIn:   / surya-pratap-kahar-47bb01168  

WEBSITE: https://techdose.co.in/

TELEGRAM Channel LINK: https://t.me/codewithTECHDOSE

TELEGRAM Group LINK: https://t.me/joinchat/SRVOIxWR4sRIVv5...
=======================================================================

CODE LINK: https://gist.github.com/SuryaPratapK/...


USEFUL LINKS:-
Implement min stack:    • Implement min stack | Leetcode #155  
Implement stack using heap or priority queue:    • Implement stack using heap or priorit...  

Комментарии

Информация по комментариям в разработке