Wednesday, September 9, 2020

Given n, how many structurally unique BST's (binary search trees) that store values 1 ... n?

Approach: Should be equal to nth Catalan number.

public int NumTrees(int n) 

{

        return Catalan(n);

}

No comments:

Post a Comment