this is the best video among all the videos on youtube explaining manacher's algorithm
@ShariqueAkhtarАй бұрын
One of the best explanations on the internet on Manachers Algo
@dhruvsingh519010 ай бұрын
best explanation found till now for this algorithm.🔥🔥
@Lime-rr6te4 жыл бұрын
this was the best manachers algo explanation i found, better that tushar roy, tech dose, nick white and so many others
@zzzzzzzmr97592 жыл бұрын
very clear and comprehensive video. The best explanation for Manacher's Algorithm!
@電腦騙徒剋星 Жыл бұрын
one of the youtuber that can explain manacher pretty well , respect
@mokshajain70192 жыл бұрын
Well Explained! Among all the videos about Manacher's Algorithm, your explanation is best. Thank you for making this video.
@vivekpandya21637 ай бұрын
Just watching first 4 mins and I found its very fluent and easy to understand. 🙏
@sanskarmani90944 жыл бұрын
Too good. Thanks for explaining it in so simple terms and also for covering every case.
@habilismayilov8383 ай бұрын
greatest explanation of this algorithm on the internet.
@ujjvalcodes36293 жыл бұрын
Best explaination on the internet
@user-coder-r6j2 ай бұрын
Thank you a lot. Only this video deeply explained an algorithm!
@shubhamagrawal75572 жыл бұрын
Great Video. Thanks for the simple and intuitive explanation!
@TobiasTEEHEE3 ай бұрын
Great explanation, thank you!
@gauravswain69072 жыл бұрын
can not understand the psudo code in over 2 times watching this, I am ok with O(n)2.
@shashwattripathi7594 жыл бұрын
All of your videos are just amazing ! Please make more videos...! Thanks a lot !
@yaswanthchunduru52983 жыл бұрын
Bro your videos are literally awesome.
@vishalbhatane16083 жыл бұрын
Nice explanation!
@sylviazhang67863 жыл бұрын
Thank you. It is very well explained.
@gerardolastra40993 жыл бұрын
Case 2 shown during 13:13 is wrong. p[i] >= p[i'] could be false, the palindrome centered in s_i' could extend back far beyond s_l. The conclusion that p[i] must be greater or equal to r-i is right, however.
@siddharthabhi87046 ай бұрын
Yes, Case 2 is wrong, zxaxz#zxaxp , where i = index of 2nd a
@motivation97184 жыл бұрын
Great explanation brother.....
@arghyadeepmandal4458 Жыл бұрын
Really good video 🙂🙂🙂
@ArpitMarkana5 ай бұрын
good explaination
@xiaoxiaodeng39574 жыл бұрын
Thank you, your video helps a lot.
@satymshrma3 ай бұрын
rather than adding hashes, you can just compare i,i (i being the centre). and make a function for it and fn(i,i) for odd, fn(i,i+1) for even.
@zaksification4 жыл бұрын
Really great explainaion
@yangthomas57217 ай бұрын
There is a little bug in the code, the --k step after expansion is mandatory.
@laraibanwar16183 жыл бұрын
Brother why did u leave making videos. They are all exceptional..
@laraibanwar16183 жыл бұрын
I will even subscribe ur channel.now Plz keep on uoloading
@sanskarmani90944 жыл бұрын
Can you also consider making a video on Ford Fulkerson max flow algorithm??
@fluentalgorithms48474 жыл бұрын
Sure!
@pranavbansal99344 жыл бұрын
best explanatiion!!
@yangthomas57217 ай бұрын
Nice video
@RAJPATEL-nm9nz4 жыл бұрын
Only one doubt why you have written, If(s[i-k]!=s[i+k]) --k
@sarathchandrakalahasti14844 жыл бұрын
Good explanation
@GaonkaEngineer1232 жыл бұрын
//c++ code class Solution { public: string getModifiedString(string s, int n){ string sb=""; for(int i = 0; i < n; i++){ sb.append("#"); sb+=s[i]; } sb.append("#"); return sb; } public: string longestPalindrome(string s1) { int m=s1.size(); string s=getModifiedString(s1,m);// expand the string for even expansion of string cout
@liupeng77573 жыл бұрын
great!
@Rohitkumar-ks9io4 жыл бұрын
Please provide a problem link related to this algorithm . you can provide it in description for further videos.
@fluentalgorithms48474 жыл бұрын
Ive added practice problems in the description.
@GaonkaEngineer1232 жыл бұрын
Best !!!!!!
@sahilsharma29524 жыл бұрын
Can you make a video on sweep line algo as a whole?
@fluentalgorithms48474 жыл бұрын
I'll consider it. For now you can refer www.topcoder.com/community/competitive-programming/tutorials/line-sweep-algorithms/
@lokeshkoliparthi92684 жыл бұрын
I want to ask one thing that does this code only work for showing odd length substrings or will it work for showing even length palindromic substrings also. I tried for the string "bbbb" on this code and this code is not working. After seeing many videos, I finally understood Manacher's algorithm seeing this video. Thanks a lot and hoping to see more videos from this channel like this. Edit: One more thing I would like ask is this condition if(S[i-k]!=s[i+k]) required as I am facing problem with that line of code and finally removed and your code is running perfect for finding odd palindromes only. Once again Thanks for amazing explanation of concept.
@kampatiraviteja73984 жыл бұрын
thats great man
@電腦騙徒剋星 Жыл бұрын
you need to add # yourself
@aishwaryarastogi72654 жыл бұрын
I think the algorithm will fail for a test case such as "cbbd"....
@jakubjastrzebski98903 ай бұрын
So let’s see what happens here We rewrite your test case into # c # b # b # d # And then we simulate the algorithm… I will do it manually… i = 0 l = 0, r = -1 i is bigger than r, k = 0 We expand k to 1 and cannot further due to the left bound limitation, k = 0 again, p[0] = 0 We extend l to 0 and r to 0 i = 1 i is bigger than r again so k = 0 We push k to 2 and it fails due to mismatch k is 1 then p[1] = 1 We extend l to 0 and r to 2 i = 2 i is equal to r so we pass to else j is equal to 0, thus k starts at 0 We run the while loop and it fails at k = 1 due to mismatch then k = 0 p[2] = 0, l = 2 and r = 2 i = 3 i is bigger than r, so k = 0 After while it fails at k = 2 so k is 1, so p[3] = 1 and l = 2, r = 4 i = 4 i isn’t bigger than r j = 2, so p[j] = 0, thus k becomes 0, it fails for k = 3 so k = 2, p[4] = 2, l = 2, r = 6 i = 5 i isn’t bigger than r j = 3, p[j] = 1, k = min(1, 6-5) we start at k = 1, it fails at 2 so k stays at 1 p[5] = 1 l = 4, r = 6 i = 6 i isn’t bigger than r j = 4, p[j] = 2, so k is min(2, 0) k fails for 1 due to mismatch and k = 0, so p[6] = 0, l = 6, r = 6 i = 7 i is bigger than r so k = 0 it fails at k = 1 cause further it cannot extend, p[7] = 1, l = 6, r = 8 i = 8 i isn’t bigger than r so j = 6, k = min(0, 0) and then fails due to the range, so p[8] = 0, l = 8, r = 8, the end of algorithm, let’s see what’s the outcome… # c # b # b # d # 0 1 0 1 2 1 0 1 0 Seems correct to me
@jakubjastrzebski98903 ай бұрын
@aishwaryastogi7265
@vinaykirpalani58043 жыл бұрын
brilliant explanation sir ! , thanks a lot
@raj13074 жыл бұрын
Can u make a solution video for the PALIN3 problem .. I am unable to understand the precomputation required in it... thanks
@fluentalgorithms48474 жыл бұрын
You can checkout my explanation here : discuss.codechef.com/t/palin3-editorial/4906/6?u=vedhant
@raj13074 жыл бұрын
@@fluentalgorithms4847 " To find ans[i], ans[i] = cnt[i+k][s[i]%3] - cnt[i][s[i]%3] will not work because sum[i] would have contributed to the sum right of I " Can u pls explain this line once? thanks
@fluentalgorithms48474 жыл бұрын
I have updated my explanation here : discuss.codechef.com/t/palin3-editorial/4906/6?u=vedhant
@raj13074 жыл бұрын
@@fluentalgorithms4847 Thanks a lot ... finally understood :)
@tekbssync57273 жыл бұрын
bhai pseodo code link wagera de diya karo
@ankurrohilla46554 жыл бұрын
❤❤❤
@arshdeepkumar25864 жыл бұрын
Great video, but try to make video at max 10 minutes it will help to retain viewers, because everyone is searching for solution in short time.