Triangle (LeetCode 120) | Easy tutorial | Bottom-up Top-down dynamic programming | StudyAlgorithms

  Рет қаралды 9,496

Nikhil Lohia

Nikhil Lohia

Күн бұрын

Пікірлер: 31
@ZenyxPlays061
@ZenyxPlays061 Ай бұрын
The way to explain dp questions i haven't seen anyone on whole youtube breaking the dp questions in that way really your channel helped me a lot understanding dp easily. Thanks a lot !
@saivignesh03
@saivignesh03 2 ай бұрын
theory-->Great explanation sir feedback--> Explain code more clearly 🤗🤗
@andrejiskra3391
@andrejiskra3391 11 ай бұрын
I think you structured your video very very well and explained the concepts and solutions perfectly. Timestamps were also very helpful. Thank you for creating this.
@nikoo28
@nikoo28 11 ай бұрын
glad you feel that way
@kunalkheeva
@kunalkheeva Жыл бұрын
Appreciate your work! Most underrated channel though! Keep posting.
@nikoo28
@nikoo28 Жыл бұрын
fingers crossed :)
@rohitrawat4055
@rohitrawat4055 2 ай бұрын
Thanks Sir , itni video's baad isme samjh aaya ....
@manojtate9604
@manojtate9604 8 ай бұрын
Your explanation was top-notch !
@taffazzelhossain4530
@taffazzelhossain4530 Ай бұрын
great explanation !!
@mohammedilyas8824
@mohammedilyas8824 2 жыл бұрын
Great explanation sir,pls bring on some most tricky interview questions frequently asked
@nikoo28
@nikoo28 2 жыл бұрын
Sure…i am adding new problems every week :)
@MD_SAMEER___
@MD_SAMEER___ 4 ай бұрын
thank you so much man! you explained so well
@vivekkumaryadav9862
@vivekkumaryadav9862 Жыл бұрын
the way that u explain with example it help a lot to understand thanks sir
@nikoo28
@nikoo28 Жыл бұрын
that is so nice of you
@saikiran1426
@saikiran1426 5 ай бұрын
Super explanation 😊
@unemployedcse3514
@unemployedcse3514 7 ай бұрын
one vedio explains gist of dynamic programming and other concepts , thank you 😍
@ssss22144
@ssss22144 Ай бұрын
Thank you annaa❤
@ganeshpatel3985
@ganeshpatel3985 Жыл бұрын
love the way you teach
@AkashYadav-di6kd
@AkashYadav-di6kd Жыл бұрын
Thank you very much, bhaiya.
@mdshariorhossainfarhan2819
@mdshariorhossainfarhan2819 Ай бұрын
I was just curious and wanted to know if recursive approach would provide a better solution to this problem for bottom up approach
@032_RishavDey
@032_RishavDey 10 ай бұрын
Sir we can optimise the Space Complexity to O(N)
@nikoo28
@nikoo28 10 ай бұрын
what will your approach be?
@032_RishavDey
@032_RishavDey 10 ай бұрын
@@nikoo28 just have one dp array of size equal to N, and initialise it with values in last row. Then perform bottom up approach. So our answer is in dp of 0.
@nikoo28
@nikoo28 10 ай бұрын
@@032_RishavDey that is indeed smart.. 😄
@saikiran1426
@saikiran1426 5 ай бұрын
How
@alirezaaramoun615
@alirezaaramoun615 5 ай бұрын
I would like to know how the top-bottom approach can be applied. I attempted to apply it but ran into difficulties. Could someone please assist me?
@leetcodebaby6680
@leetcodebaby6680 2 жыл бұрын
When you were explaining the problem, you left explaining after 2 rows when things really started becoming tricky. You left at the point when it was most needed.
@nikoo28
@nikoo28 2 жыл бұрын
I discuss 2 approaches in the solution, a top-down and a bottom-up approach. Does that help? Can you tell me the timestamp at which you struggled? I can help more.
@vivekkumaryadav9862
@vivekkumaryadav9862 Жыл бұрын
TC -> O(n^2) S.C -> O(n^2)
@happyVibesOnly1618
@happyVibesOnly1618 Ай бұрын
Brut force had better space complexity. public class TriangleMinPathSum { public int minimumTotal(List triangle) { return helper(triangle, 0, 0); } // Recursive helper method to find the minimum path sum private int helper(List triangle, int row, int col) { // Base case: if we reach the last row if (row == triangle.size() - 1) { return triangle.get(row).get(col); } // Recur to find the minimum path sum from the left and right children int leftPath = helper(triangle, row + 1, col); int rightPath = helper(triangle, row + 1, col + 1); // Current element + minimum of both paths return triangle.get(row).get(col) + Math.min(leftPath, rightPath); } }
@Rocky-me7qh
@Rocky-me7qh 9 күн бұрын
This problem is irritating
小丑教训坏蛋 #小丑 #天使 #shorts
00:49
好人小丑
Рет қаралды 54 МЛН
小丑女COCO的审判。#天使 #小丑 #超人不会飞
00:53
超人不会飞
Рет қаралды 16 МЛН
UFC 310 : Рахмонов VS Мачадо Гэрри
05:00
Setanta Sports UFC
Рет қаралды 1,2 МЛН
Mastering Dynamic Programming - How to solve any interview problem (Part 1)
19:41
LeetCode was HARD until I Learned these 15 Patterns
13:00
Ashish Pratap Singh
Рет қаралды 761 М.
Triangle - Dynamic Programming made Easy - Leetcode 120
15:06
5 Simple Steps for Solving Dynamic Programming Problems
21:27
Reducible
Рет қаралды 1,1 МЛН
Dynamic Programming isn't too hard. You just don't know what it is.
22:31
DecodingIntuition
Рет қаралды 243 М.
小丑教训坏蛋 #小丑 #天使 #shorts
00:49
好人小丑
Рет қаралды 54 МЛН