Palindrome Partitioning of a String Recursive | Backtracking Algorithm in JAVA

preview_player
Показать описание

NADOS also enables doubt support, career opportunities and contests besides free of charge content for learning. In this video, we explain palindrome partitions of a string using recursion and backtracking. We state the problem where:

1. You are given a string of length n.
2. You have to partition the given string in such a way that every partition is a palindrome.

.....................................................................................................................................................................

Pepcoding has taken the initiative to provide counselling and learning resources to all curious, skilful and dedicated Indian coders. This video is part of the series to impart industry-level web development and programming skills in the community.

We also provide professional courses with live classes and placement opportunities.
DSA Level 1 and Level 2

Webinar on GATE Preparation

We are also available on the following social media platforms: -

HAPPY PROGRAMMING!
Pep it up......

#recursion #backtracking #palindromes
Рекомендации по теме
Комментарии
Автор

I struggled with this problem for so long. Reached a point of memorizing the solution. But somehow stumbled upon this video. As others said- by far the best explanation! Thank you pepcoding!!

sarveshkaushal
Автор

by passing the answer so far in the function you have removed the need for adding back tracking line additionaly. Really liked it.

kalpeshsaubhri
Автор

Sumit sir no one explains better than you...always a crystal clear and to-the-point explanation. Thanks a lot

imajt
Автор

Sir you have the real skill of making tough problems easy. Your teaching level is awesome. Thanks a lot for this video.

MohitG
Автор

It took me days to understand solutions of different yt channels, but your solution just clicked. Thanks

dnagardhankar
Автор

Students: Yar Itni mehengi Coaching hoti h kaise coding sikhenge internet pe to itna sab h kha se pde kya hoga humara..

Pepcoding: hum abhi Zinda h..

Salute to you Vision sir.. Highly inspired by you.

kanhamishra
Автор

Hands down one of the best explanation to this problem sir.

kanhamishra
Автор

Best place to understand recursion tree! Thanks

mohitsharma
Автор

sir i wish i become half as good as you. you are an inspiration.

shaikhfaisal
Автор

Really easy to understand explanation! Thank you! Subscribed!

dheerajjodha
Автор

Best explanation on YouTube nice and simple best way to explain

NiteshKumar-doen
Автор

This question a Combinations-1 question!!!

Partition is formed by placing a wall/walls in between the string.

ex : for string = "abcg" -> partition {a, bcg} = placing a wall in between a and b -> a | b c g

Hence the question boils down to

basically: Find all Combinations of flags such that all the partitioned strings are Palindromes.

For a String of Length 'n' -> Total possible placements of flags = 'n-1' (ex: string = "abcg" -> All possible flag placements -> a | b | c | g )

therefore 2^(n-1) ways to place the partitions.

Just while placing partitions make sure -> prefix is a palindrome.

rishabhgoyal
Автор

Sir, you made this question look very easy. Thank you, 200 done. Only 800 to go.

priyanshu.tiwari
Автор

Stucked on it for a long time finally solve it Thanks !

prabaljain
Автор

Best explanation for this problem sir!

HemanthaKumarYadav
Автор

Sir you made me fall in love with recursion.. I am currently in class 12th. When I was in 11th standard I used to fear this topic very much...
Thank you sir❤️❤️❤️

tuhinmotivation
Автор

"Best teaching" with "Best singing" 7:17

dharmeshupadhyay
Автор

Sir why do you skip Time and Space complexity analysis for every problem? I think it's very important to discuss Time and Space complexity in the interviews. Please try not to skip it. Thank you.

PerpetualLearner
Автор

best part chala chala sa lag rha or chal gea

ghanibhai
Автор

sir ye insight kaise bnegi ki prefix wali technique se draw krenge ham recusrion ka tree, maine kuch krne ka try kiya but hila nhi question khudse

mickyman
visit shbcf.ru