Monotonic Stack Pattern Identification | DSA Practice

  Рет қаралды 1,923

Shrayansh Jain

Shrayansh Jain

Күн бұрын

Пікірлер: 9
@AkashKumar-bp6rn
@AkashKumar-bp6rn 18 күн бұрын
Great video! Please I request to continue this DSA pattern identification series ❤
@barath-vz5bq
@barath-vz5bq 9 күн бұрын
Thank you👏
@XoloVibes
@XoloVibes 16 күн бұрын
Please continue DSA related videos
@IntenseMovieClips
@IntenseMovieClips 18 күн бұрын
This is really very helpful.
@sharathkumarhk4260
@sharathkumarhk4260 18 күн бұрын
Summary for myself: To find the next greater or smaller elements, previous greater or smaller, we can make use of the monotonic stack. Calculation wise, if you want the previous greater or smaller. You will start from the left, because you need to know those previous numbers to identify prev greater or smaller wrt current position. Similarly, for the upcoming greater or smaller, you're gonna start from the right. To find the next greater element, you're gonna maintain the stack in decreasing order. To find the next smaller element, you're gonna maintain the stack in increasing order. You need to balance the stack first and then read the value from the stack to identify the next greater or smaller value. If there is nothing in the stack. It means -1 not found.
@sohansingh2022
@sohansingh2022 18 күн бұрын
Thanks
@ankurrajput2367
@ankurrajput2367 18 күн бұрын
If in the bruteforce approach we are using nested loop then we can use stack.
@harinidevi259
@harinidevi259 18 күн бұрын
Sir,What about your google interview?
@JainShrayansh
@JainShrayansh 18 күн бұрын
its there in jan
Google Coding Round Practise | DSA, Find Peak Element in O(Logn)
9:04
Shrayansh Jain
Рет қаралды 1,4 М.
Binary Search Pattern Identification | DSA Practice
18:04
Shrayansh Jain
Рет қаралды 702
It works #beatbox #tiktok
00:34
BeatboxJCOP
Рет қаралды 41 МЛН
We Attempted The Impossible 😱
00:54
Topper Guild
Рет қаралды 56 МЛН
黑天使被操控了#short #angel #clown
00:40
Super Beauty team
Рет қаралды 61 МЛН
8 Design Patterns | Prime Reacts
22:10
ThePrimeTime
Рет қаралды 452 М.
Making an Algorithm Faster
30:08
NeetCodeIO
Рет қаралды 196 М.
Software Engineers have no Deep Knowledge now?
8:54
Roman V.
Рет қаралды 6 М.
739. Daily Temperatures | Monotonic Stack | Space Optimisation O(1)
28:11
Microservices with Databases can be challenging...
20:52
Software Developer Diaries
Рет қаралды 120 М.
LeetCode was HARD until I Learned these 15 Patterns
13:00
Ashish Pratap Singh
Рет қаралды 734 М.
Why Await Twice With The Fetch API
16:48
Deeecode The Web
Рет қаралды 3 М.
Microservices are Technical Debt
31:59
NeetCodeIO
Рет қаралды 736 М.
8 Data Structures Every Programmer Should Know
17:09
ForrestKnight
Рет қаралды 243 М.
are we cooked w/ o3?
13:58
ThePrimeTime
Рет қаралды 327 М.
It works #beatbox #tiktok
00:34
BeatboxJCOP
Рет қаралды 41 МЛН