Skip to content

Instantly share code, notes, and snippets.

@deque-blog
Created December 17, 2016 15:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save deque-blog/891bbb44c787b0cc06f3a166f0c63dc9 to your computer and use it in GitHub Desktop.
Save deque-blog/891bbb44c787b0cc06f3a166f0c63dc9 to your computer and use it in GitHub Desktop.
bstCount :: (Int -> Integer) -> Int -> Integer
bstCount rec n
| n <= 1 = 1
| otherwise = sum [rec i * rec (n-1-i) | i <- [0..n-1]]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment