Tutorial 7
Tutorial 7
Dynamic Programming 2
1 Number of parenthesis
Count the number of expressions containing n pairs of parentheses that are correctly matched. For n = 3,
possible expressions are ((())), ()(()), ()()(), (())(), (()()).
Note: The above number is also called Catalan number which can be computed faster, but think of DP
approach to count number of possibilities.
5 Programming
Solve and submit on codechef by end of the week.
• https://www.codechef.com/SEP12/problems-old/CROWD
• https://www.codechef.com/problems/CR195