Doubt in finding index of lexographically sorted balanced parantheses.

Revision en6, by atlasworld, 2019-05-27 14:05:26

We are to find the index of lexographically sorted balanced brakcet sequence.

I was referring to cpalgorithms, but couldn't understood,

while calculate the index number when we get ")" , why we are adding dp[2*n-i-1][depth+1] to our answer. what is the intution behind it.

Please help!

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en10 English atlasworld 2019-05-28 20:36:41 27 Tiny change: 'e help\n\n' -> 'e help\n\nwhy no one is replying ? \n'
en9 English atlasworld 2019-05-28 17:15:40 41 Tiny change: ' tell >> >\n\n\n' -> ' tell >> > [user:Errichto] Please help\n\n'
en8 English atlasworld 2019-05-28 07:53:55 16
en7 English atlasworld 2019-05-28 06:09:57 22 Tiny change: 'nd it.\n\nPlease help! \n\n\n' -> 'nd it.\n\nSomeone pls tell >> >\n\n\n'
en6 English atlasworld 2019-05-27 14:05:26 13
en5 English atlasworld 2019-05-27 14:05:00 11
en4 English atlasworld 2019-05-27 13:02:35 22 Tiny change: 'hind it.\ncan someone tell ! \n' -> 'hind it.\n\nPlease help! \n\n\n'
en3 English atlasworld 2019-05-27 12:43:09 17 Tiny change: 'hind it.\nAnyone ?\n' -> 'hind it.\ncan someone tell ! \n'
en2 English atlasworld 2019-05-27 12:42:32 11
en1 English atlasworld 2019-05-27 12:42:04 411 Initial revision (published)