Zig-Zag World of Algorithm and Data Structures
Home
(Move to ...)
Home
Basic Data Structures
Advance Data Structures
Algorithms
Exercises
Interview Questions
Puzzles
Design Questions
Conferences and Papers
About The Blog
▼
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
‹
›
Home
View web version
No comments:
Post a Comment