Data Structures & AlgorithmsHardGATE CS · TCS NQT

How many valid balanced bracket strings with 3 pairs begin with an opening bracket and are balanced, where the string has exactly 6 characters?

  1. A. 6
  2. B. 7
  3. C. 5
  4. D. 9

Correct answer: C. 5

Every balanced string starts with '(' so this is the Catalan number C3 = 5, the same as the number of balanced strings of length 6.

More Arrays, Strings, Linked Lists, Stacks, Queues and Hashing questions

Exams that ask this topic