Which mathematical sequence gives the number of structurally distinct BSTs that can be formed using N distinct keys?
Options
- A. Fibonacci sequence
- B. Arithmetic progression
- C. Catalan sequence
- D. More than one of the above
- E. None of the above
Quiz Practice:
C. Catalan sequence
The number of structurally distinct BSTs formed using N distinct keys is given by the Catalan sequence. The first values are 1, 1, 2, 5, 14, 42, 132 and so on. Catalan numbers also occur in problems involving valid parentheses, full binary trees, polygon triangulations and different ways of parenthesizing expressions. Recognizing Catalan-number patterns can quickly solve several DSA counting questions.