python
The number of possible binary tree topologies (given all possible heights) with n nodes is the Catalan Number (in closed form) Cn = 1/(n+1)*(2n choose n). Recursively, this can also be written as:
question ) Write a function cn_fast(n) that computes the n-th catalan number using the closed form formulation, and Conduct doubling experiments (just n = 1, 2, 4, and 8) to compute runtimes. Plot the result on a log-log plot.
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here