Question 12Asked in UGC NET Computer Science, June 2016 (Paper II & III, Selected Questions)

In how many ways can the string A ∩ B – A ∩ B – A

In how many ways can the string A ∩ B – A ∩ B – A be fully parenthesized to yield an infix expression?
  1. A15
  2. B14
  3. C13
  4. D12
Show answerHide answer

Correct answer: (B) 14

Explanation

The number of ways to fully parenthesize an expression with n operators is the Catalan number C(n) = (1/(n + 1)) × ²ⁿCₙ. Here the number of operators is n = 4, so C(4) = (1/5) × ⁸C₄ = (1/5) × 8!/(4! 4!) = 70/5 = 14. Note: All operators work as nodes of a binary tree.

From UGC NET Computer Science PYQ, June 2016 (Paper II & III, Selected Questions)

This is question 12 of UGC NET Computer Science PYQ, June 2016 (Paper II & III, Selected Questions). See all questions of this paper with answers, or attempt the paper as a timed online test to get your score and all-India rank.