How many sub-trees a binary tree has?

1.2k views Asked by At

Given a binary tree with n nodes. We can use in-order to represent the tree as an array of nodes. Would it be a fair assumption to say that I can represent any sub-tree by choosing 2 nodes from the in-order array? So that the total number of sub-trees is (n choose 2) which is O(n^2) or is the total number of sub-trees is O(2^n)?

Edit: I don't need to find the exact number, but know the approximate number.

Thanks!

0

There are 0 answers