Recursion & Backtracking in Python | Generate Balanced Paranthesis

preview_player
Показать описание
In this video, Prateek Bhayia discuses about how Recursion and Backtracking is implemented in Python by solving one problem from Online Course. He discussed how to generate n pair of balanced paranthesis.
Link to Problem Statement -

Get the complete course on Coding Blocks Online.
Рекомендации по теме
Комментарии
Автор

What if you can't number of opening brackets and closing brackets is not in the parameter?

amoschoo
Автор

What happened after the calling function.
How can we reach to pop
And how does return statement works?

somyagoyal
Автор

As always you are the best in explaining the concepts.

kshitijbansal
Автор

What I'm having trouble understanding is how and why it makes it to s.pop() so that it can recurs through an Nth time, and why it doesn't simply provide the same solution the second time. When I go step by step, I can understand how it makes it to the first solution logically, but after that I'm lost.

FrankSimser
Автор

n=3 should give 4 outputs [ ( ( ( ) ) ) ], [ ( ) ( ) ( ) ], [ ( ( ) ) ( ) ], [ ( ) ( ( ) ) ] hence incorrect code

yugchoudhary
Автор

can explain much better....voice got strucked many times

bhavanishanker
Автор

Sir u submitted python 3 code in python 2😂

saisanjaynagarur
Автор

Frankly, this is bad code. The concept is there, but this is basically Java code written in Python. The notion of using a list instead of a string "because strings are not mutable" is silly. Strings are perfect for this because you can construct and discard them, and you wouldn't have to do the append/pop steps: just `s + ')'` and `s + '('`.

austinhastings
visit shbcf.ru