Question 3676 – Data-Structures
November 28, 2023Question 3697 – Data-Structures
November 28, 2023Question 3678 – Data-Structures
In how many ways can the string
A ∩ B – A ∩ B – A
be fully parenthesized to yield an infix expression?
Correct Answer: B
Question 407 Explanation:
In this problem look very difficult to solve, but problem is following standard formula only.
Step-1: Total number of letters/operands with duplication is 5.
Step-3: To find total number of ways, we have catalan formula.
Here, n=5
Catalan number = (2n)! / (n! * (n+1)!)
= (2*5)! / (5! * (5+1)!)
= 10! / (5! * 6!)
= 14
Note: We used catalan formula because they given in fully parenthesized to yield an infix expression.
Step-1: Total number of letters/operands with duplication is 5.
Step-3: To find total number of ways, we have catalan formula.
Here, n=5
Catalan number = (2n)! / (n! * (n+1)!)
= (2*5)! / (5! * (5+1)!)
= 10! / (5! * 6!)
= 14
Note: We used catalan formula because they given in fully parenthesized to yield an infix expression.
15
14
13
12
Subscribe
Login
0 Comments