COSC5313 Program-3 Due: 4/8/2013 BPE Generation/Ranking Write a well-structured and well-documented program that does the following: 1. Generate all Balanced Parentheses Expressions of length 8, 10 and 12, respectively. 2. For each of above three lengths, Print out the total count of all distinct expressions and all expressions (the counts should be 14, 42 and 132). 3. Read the following ten expressions given and calculate the generating rank of each of these and print out both the expression and its rank. Of course, the generating rank depends on the sequence in which expressions of the same length are generated. For this program, it is suggested that expressions are generated in such an order that, in the corresponding binary trees, right subtrees change first before left subtrees and left subtrees change from the largest to smallest while right subtrees change from the smallest to largest. Input expressions: Use the following 10 input expressions for the Ranking. ()()()()() ::: 1 2 3 4 5 WITH THE RANK OF::: 42 ()()((())) ::: 1 2 5 4 3 WITH THE RANK OF::: 38 ()(()()()) ::: 1 3 4 5 2 WITH THE RANK OF::: 33 ()(()(())) ::: 1 3 5 4 2 WITH THE RANK OF::: 32 (((()()))) ::: 4 5 3 2 1 WITH THE RANK OF::: 2 (((((()))))) ::: 6 5 4 3 2 1 WITH THE RANK OF::: 1 (())(((()))) ::: 2 1 6 5 4 3 WITH THE RANK OF::: 77 (())((()())) ::: 2 1 5 6 4 3 WITH THE RANK OF::: 78 (())((())()) ::: 2 1 5 4 6 3 WITH THE RANK OF::: 79 ()()()()()() ::: 1 2 3 4 5 6 WITH THE RANK OF::: 132