Very well explained, would be easier to learn without the moving background.
@JackHou-vw7hs Жыл бұрын
I loved the moving background. It helped me stay focused
@bluesteel1 Жыл бұрын
Everything was fine before i read your comment. Now i cant ignore it .
@jigar2238 Жыл бұрын
@@bluesteel1 😆
@siddhantprakash.9 ай бұрын
@@bluesteel1 😂
@adityapratapsinghtomer36242 ай бұрын
@@JackHou-vw7hs my man
@sibiranganath3 ай бұрын
It's a god level explanation of monotonic stack. A request from your rest subscriber: Don't have that running background in the tutorial it's irritating .
@PssGameplayER Жыл бұрын
first time heard about Monotonic Stack, thanks for explaining it so properly
@algo.monster Жыл бұрын
Our pleasure!
@biswajeetpadhi100 Жыл бұрын
the background of this video is greatly designed. its very easy to focus with this background in motion
@algo.monster Жыл бұрын
can't tell if it's positive or sarcasm haha but yeah glad you like it!
@biswajeetpadhi100 Жыл бұрын
@@algo.monster the background in motion acts as a boundary to the actual content, so I think it really works.
@szymonpiechutowski2340 Жыл бұрын
I am a complete opposite to this idea, I feel like this 🤮 when I see it. It is not optimal for every 🧠
@Brxndz_Ай бұрын
This helped me solve Next Greater element without looking at your code, thanks!
@yoDQ10 ай бұрын
Thank you for the monotonic stack explainer. It may be helpful to also show an image of the heights array above the image of the answer array to help visualize the relationship between the two better while popping and inserting.
@KuaisArts Жыл бұрын
Wow! Thanks for walking through the example, it was very insightful
@guinea_hornАй бұрын
Really good explanation. I'll agree with everyone else and say that the background is extremely distracting, and it actually makes the bitrate of the whole video go down, making the quality poor whether I select 144p or 1080p. I also feel like you didn't explain the algorithm before going through the problem with the heights of people. You started going through the example, but I didn't know precisely what it was you were doing or why you were making the decisions that you were making. I think it would be nice to have a plain explanation of the problem and how the algorithm solves it before going through the problem step by step.
@11csepratikshaargulewar71Ай бұрын
I kindly request that you should make videos avoiding moving backgrounds, as they can be distracting while concentrating . By the way, great explanation!
@algo.monsterАй бұрын
Noted thanks!
@sandeepamarnath3295 Жыл бұрын
Great video thanks. Trying to understand how the monotonic stack approach would be of O(n) time. We traverse the array only once for sure, but what about the pop operations? For a few elements of array, we are popping out of stack multiple times until we find a stack element that is greater than the current element, so are we not counting this towards the time complexity? If length of stack is k, wouldn't the overall time be O(nk)? Thanks again!
@algo.monster Жыл бұрын
Every element in the array is processed exactly once. When an element is popped from the stack, it does not re-enter. Consequently, the maximum number of operations is 2n, accounting for each element being pushed and popped once.
@LunaOoze5 ай бұрын
Perfect explanation, thank you !
@algo.monster5 ай бұрын
Glad it was helpful!
@ignassablinskas91757 ай бұрын
Very nice explanation, great job.
@algo.monster6 ай бұрын
Thank you!
@AyaGamal20102 ай бұрын
Great!
@hardiksinghal13605 ай бұрын
Awesome explaination
@nagendrabommireddi84379 ай бұрын
wow very good explanation. thank you..
@helloguys9201 Жыл бұрын
Wonderful Explanation and PPT's
@algo.monster Жыл бұрын
Glad you liked it!
@sharwariphadnis1298 Жыл бұрын
Awesome video! Easy to understand
@alexsinx Жыл бұрын
Why is the time complexity O(n) if we have two nested loops? shouldn't it be o(n*m) where n is the number of elements in the array and m is the number of elements in the stack?
@algo.monster Жыл бұрын
The code can be indeed deceiving. But remember each element enters or exits at most once. This is why monotonic stack is a efficient data structure.
@dhruvsakariya3129 Жыл бұрын
you made it very easy by making visualizing approach. Thanks
@algo.monster Жыл бұрын
Glad it was helpful!
@rahbanghani409710 ай бұрын
would you be kind enough to share what is the application that you are using for the walk through of the solution :) Thank you in advance.
@Spamuse-w3i10 ай бұрын
The background is too distracting
@himanshigarg14313 ай бұрын
Thank you so much
@algo.monster2 ай бұрын
You're most welcome
@googleit2490 Жыл бұрын
New Topic Learned!! Sep'11, 2023 06:36 pm
@aleksandr_t Жыл бұрын
Great video, thank you a lot!
@algo.monster Жыл бұрын
Glad it helped!
@MahmoudHassan-m2t2 ай бұрын
thanks
@Avighna11 ай бұрын
Before learning this, I'd just use a segment tree for the first question xD.
@literallyjustsomegirl10 ай бұрын
So helpful 😭🖤
@algo.monster10 ай бұрын
Glad it helped!
@parulgarg5362 Жыл бұрын
Thanks for the video! Feedback on the moving background : VERY DISTURBING
@algo.monster Жыл бұрын
Thanks and Noted!
@Tough802Peter Жыл бұрын
bro is god
@AINikunjGour Жыл бұрын
You are Osm bro..
@algo.monster Жыл бұрын
Thanks ✌️
@codemonkey0077 ай бұрын
Why the solution iterative the array from right side to left side, is this order matter?
@TragicGFuel4 ай бұрын
The order is a choice, you could have used a strictly increasing function instead
@gmoney_swag1274Ай бұрын
Couldn’t you also go from left to right? You could store the indexes in the stack and as soon as you add an element greater than the element at the top of the stack, you keep removing the top until it’s equal or greater to the new element, while updating their values (sorry for the bad explanation)
@dimahodan232 Жыл бұрын
why brute force is O(n^2)? Each element doesn't start from the beginning of the array. Isn't it O(n*m) where m is i - k - 1? where k is the current element.
@algo.monster Жыл бұрын
k is not an input parameter. we have to express it in n. after dropping the content it's n^2
@douglas5260 Жыл бұрын
its n-1 + n-2 +n-3 ... = n**2
@BurtPredrag Жыл бұрын
@@douglas5260 its not multiplication it should be addition
@douglas5260 Жыл бұрын
@@BurtPredrag Yeah, I've corrected it. Thanks!
@tauicsicsics2 ай бұрын
great explanation but the moving background really makes me dizzy, could not watch it for more than 1 minute
@bluesteel1 Жыл бұрын
Nice
@kaszatus211 ай бұрын
Literally the worst sample, because not much of exploration... Maybe thats why for you its most confusing... As so its this video...
@RahulBansal146 ай бұрын
The moving background make it hard to follow.
@samueladdisu37293 ай бұрын
The moving background is very distracting. I can't even watch the full video
@bogdan20611 ай бұрын
bro remove that background!
@ed2023bc16 сағат бұрын
Slow down, it's not a race. Unless you don't understand what you are doing.