Palindrome Partitioning Dynamic Programming

  Рет қаралды 26,521

IDeserve

IDeserve

Күн бұрын

Пікірлер: 64
@blatogh1277
@blatogh1277 3 жыл бұрын
that makes my life easier. In my opinion, to test whether is a palindrome, we just need to have a test function to go over the substring and determine whether this substring is palindrome or not.
@hoyinli7462
@hoyinli7462 2 жыл бұрын
you are the only 1 DP solution I really understand! Thank you!
@IDeserve
@IDeserve 2 жыл бұрын
Thanks Ho Yin Li!!
@gyanasahu1006
@gyanasahu1006 3 жыл бұрын
There is a better approach to constructing this dp table. The flaw here is we are constructing row by row and we have to look at row + 1 for updating dp[row][1..]. Do it by length, which is more intuitive. Below is the code: for(int i=1; i
@34_harshdeepraghuwanshi98
@34_harshdeepraghuwanshi98 3 жыл бұрын
Awesome 15 min explanation
@IDeserve
@IDeserve 3 жыл бұрын
Thanks Harshdeep!
@anmoljain5846
@anmoljain5846 3 жыл бұрын
thank you, sir. I was trying to get it from many resources, finally, I got it through this video
@IDeserve
@IDeserve 8 жыл бұрын
Dear Friends, If you like our content and would like us to continue making great content for you, please spread the word about IDeserve. A share/appreciation from you on social network would mean the world to us! Also, do like our Facebook page: facebook.com/IDeserve.co.in :) Thanks, -Team IDeserve.
@aadityasharma9790
@aadityasharma9790 2 жыл бұрын
you deserve more subscriber man!
@IDeserve
@IDeserve 2 жыл бұрын
🥺
@aniket7512
@aniket7512 4 жыл бұрын
God Level Explanation. Thanks bro was finding this whole day !
@IDeserve
@IDeserve 4 жыл бұрын
Wow! Thanks Aniket!
@aniket7512
@aniket7512 4 жыл бұрын
@@IDeserve Bro u truly deserve it. I guess that's why u named d channel IDeserve😂....Jokes apart keep uploading great content 😊 ATB
@himanshusrihsk4302
@himanshusrihsk4302 4 жыл бұрын
Best Explanation ever. Sir plz provide solutions for problem in leetcode medium and hard questions
@bhavukgarg3619
@bhavukgarg3619 5 жыл бұрын
Sir your videos are always helpful, Just got to search for that ideserve logo, and my doubts are clear.
@IDeserve
@IDeserve 5 жыл бұрын
Thanks for your kind words Bhavuk!
@NitinSingh-hk3vy
@NitinSingh-hk3vy 2 жыл бұрын
Thanks brother, this video helped me a lot🙌. Keep doing 👍
@IDeserve
@IDeserve 2 жыл бұрын
😊
@pathikritchanda62
@pathikritchanda62 3 жыл бұрын
Thank you sir for this approach , hope for such great content in future too .
@namanvijay3514
@namanvijay3514 3 жыл бұрын
Best explanation 👍
@Ice-2706
@Ice-2706 4 жыл бұрын
Thanks bro and keep posting more videos they are helpful !!
@sujan_kumar_mitra
@sujan_kumar_mitra 3 жыл бұрын
Nice Explanation
@karthiknedunchezhiyan5136
@karthiknedunchezhiyan5136 7 жыл бұрын
Instead of keeping boolean matrix it is easy to count the minimum cut in matrix itself..... then return top right corner value
@lifehacks9450
@lifehacks9450 4 жыл бұрын
Please upload more why did u stopped
@mohakchaudhary1981
@mohakchaudhary1981 5 жыл бұрын
Best explanation of this problem 🎈⚡⚡😀
@IDeserve
@IDeserve 5 жыл бұрын
Thanks Mohak!
@haimbendanan
@haimbendanan 8 жыл бұрын
Why is the brute force n^3 ? All the string partition possibilities aren't 2^(n-1) ? Or am I missing something? Thanks!
@11m0
@11m0 8 жыл бұрын
I dont get it either...Did u figure this out?
@neerajjoshi9493
@neerajjoshi9493 7 жыл бұрын
actually brute force here refers to another DP approach which is not as good as this DP approach.
@manjesh80
@manjesh80 6 жыл бұрын
Its n^2 + n^2 . === n^2 ... compare to other approaches .. which is n^3 If n = 1000 n^2 ==> 1000000 ==> 1 Million n^3 == 1000000000 ==> 1 Billion n^2 + n^2 ==> 2 Million
@shiwanggupta8608
@shiwanggupta8608 6 жыл бұрын
Actually its not brute force..using brute force it would be O(n*2^n) using dynamic programming we can achieve O(n^2) using different approach www.geeksforgeeks.org/dynamic-programming-set-17-palindrome-partitioning/
@anonymoussloth6687
@anonymoussloth6687 2 жыл бұрын
Brute force would be 2^n because u r not checking all substrings. U r checking all valid cuts. You have n positions where you can place the cut and you have two options at each position to cut it or not cut it
@ameyapatil1139
@ameyapatil1139 4 жыл бұрын
Excellent work !
@harveylastname1523
@harveylastname1523 8 жыл бұрын
The table of 2D information is not used all, you can save the integer but not boolean only.Save the min(T[i][j] = 1+ Min(T[i][k] , T[k][j-1]) to the table 2D, so the T[i][j] is the answer.
@Vinny254
@Vinny254 3 жыл бұрын
Tried to print the substrings ... anyone managed to get the minimum substrings as a list instead ?
@chrisogonas
@chrisogonas 3 жыл бұрын
WOW, that was helpful. Thanks
@kushal1
@kushal1 4 жыл бұрын
Great video... Just one thing I didn't get the intuition behind dp[j] + 1. Difficult to understand. Dry run makes little more sense but still. Could have been explained better.
@falakk22
@falakk22 7 жыл бұрын
Amazing , please keep adding more probs . Is there any book that we should refer to look out for such questions ? Any recommendation . Thanks .
@vorasagar7
@vorasagar7 6 жыл бұрын
solve leetcode or use ctci for questions
@rishitgupta7848
@rishitgupta7848 3 жыл бұрын
Thank you!
@SurendraSingh-hp9gk
@SurendraSingh-hp9gk 5 жыл бұрын
thank you ideserve.
@08JuHan
@08JuHan 4 жыл бұрын
great tutorial! thanks a lot for your help
@IDeserve
@IDeserve 4 жыл бұрын
Thanks!
@sajalagrawal1430
@sajalagrawal1430 4 жыл бұрын
@@IDeserve why have you stopped uploading?
@varunnarayanan8720
@varunnarayanan8720 4 жыл бұрын
Well explained..
@justanaverageguy4739
@justanaverageguy4739 4 жыл бұрын
this is O(n^3) solution right?
@Sushil2874
@Sushil2874 4 жыл бұрын
Nice explanataion..!!
@IDeserve
@IDeserve 4 жыл бұрын
Thanks Sushil!
@vicentefelipe4287
@vicentefelipe4287 7 жыл бұрын
loved this video, super helpful, can you do Palindrome Partitioning, where you return all possible palindrome partitioning of s. For example, given "aab". return [["aa","b"], ["a","a","b"]]
@mkay7800
@mkay7800 3 жыл бұрын
Its Awesome 🔥🔥
@karthiksharma8720
@karthiksharma8720 5 жыл бұрын
Sir you are awsome
@IDeserve
@IDeserve 5 жыл бұрын
Karthik you are awesome 😊
@varunkunchakuri1204
@varunkunchakuri1204 8 жыл бұрын
i don't think there is brute force way of o(n^3) please check
@pownarthithimiridayasagar2229
@pownarthithimiridayasagar2229 8 жыл бұрын
I think, by Brute force they mean calculating min cut for every possible substring in the string.
@bipul2138
@bipul2138 4 жыл бұрын
That one is also based on DP
@lemonginger001
@lemonginger001 6 жыл бұрын
explained nicely :)
@IDeserve
@IDeserve 6 жыл бұрын
Thank you so much Yash for your kind words :)
@ZiiiP2142
@ZiiiP2142 7 жыл бұрын
Awesome.
@IDeserve
@IDeserve 7 жыл бұрын
Thanks primaltare for your kind words :) We would really appreciate if you could spread the word about IDeserve in your college and to your colleagues. Also please check out our website at: www.ideserve.co.in It has features like Algorithm Visualization, Learn Together and many more coming soon. Please check it out and leave us a comment there! Thanks, -Team IDeserve.
@shaivalchokshi3424
@shaivalchokshi3424 9 жыл бұрын
Nice, thank you :)
@IDeserve
@IDeserve 9 жыл бұрын
+shaival chokshi Thanks a lot for your words! It is very encouraging to hear such comments! We would really appreciate if you could spread the word about IDeserve in your college and to your colleagues. Also please check out our website at: www.ideserve.co.in It has features like algorithm visualizations, learn together and many more coming soon. We are uploading new topics everyday. Please check it out and leave us a comment there! Thanks, -Team IDeserve.
@shaivalchokshi3424
@shaivalchokshi3424 9 жыл бұрын
Yes, i've been watching a lot of videos of yours :) they're all too helpful
@IDeserve
@IDeserve 9 жыл бұрын
+shaival chokshi Thanks a lot for appreciating!
Longest Palindromic Substring O(N) Manacher's Algorithm
23:49
IDeserve
Рет қаралды 173 М.
Haunted House 😰😨 LeoNata family #shorts
00:37
LeoNata Family
Рет қаралды 15 МЛН
HELP!!!
00:46
Natan por Aí
Рет қаралды 71 МЛН
[Java] Leetcode 131. Palindrome Partitioning [Backtracking #7]
11:14
Eric Programming
Рет қаралды 2,6 М.
Shortest Palindrome O(N)
9:53
IDeserve
Рет қаралды 36 М.
Being Competent With Coding Is More Fun
11:13
TheVimeagen
Рет қаралды 113 М.
Building Bridges Dynamic Programming
10:35
IDeserve
Рет қаралды 16 М.
Palindrome Partitioning - Backtracking - Leetcode 131
10:24
NeetCode
Рет қаралды 136 М.
Premature Optimization
12:39
CodeAesthetic
Рет қаралды 833 М.
Longest Palindromic Subsequence
9:18
Tushar Roy - Coding Made Simple
Рет қаралды 316 М.
Dynamic Programming isn't too hard. You just don't know what it is.
22:31
DecodingIntuition
Рет қаралды 195 М.
L17. Palindrome Partitioning | Leetcode | Recursion | C++ | Java
24:34
take U forward
Рет қаралды 285 М.