-1

How many binary tree shapes of N nodes are there with height N-1? Also, how would you go about proofing by induction?

So binary tree of height n-1 with node n means all node will have only 1 child, sort of chain like structure? So number of binary tree will be different permutation of n numbers which is n. Am I thinking in the right direction?

Asia x3
  • 606
  • 2
  • 16
  • 37
  • 1
    Get out a pencil and paper, and draw all the shapes for trees of size 1, 2, 3, and 4. I suspect you'll have the formula figured out by the time you finish drawing all the possible tree shapes that have 4 nodes. – Jim Mischel Sep 04 '15 at 12:41
  • Are the trees leaf-labeled (meaning that, e.g., the complete height-2 binary tree with leaves reading from left to right 1, 2, 3, 4 is considered to be distinct from the "same" tree but with leaves reading 3, 4, 1, 2) and if so, are they ordered (meaning that, e.g., the tree with leaf sequence 1, 2, 3, 4 is considered to be distinct from the one with 2, 1, 4, 3)? There are even other possibilities (e.g. vertex-labeled) but these are *probably* not what you meant. – j_random_hacker Sep 04 '15 at 12:50
  • @j_random_hacker I guess "tree shapes" means that there are no node labels at all – Niklas B. Sep 04 '15 at 14:50
  • @NiklasB That is correct no node labels – Asia x3 Sep 04 '15 at 15:52

1 Answers1

0

You are thinking in the right direction and you have correctly transformed the original problem to a simple one. However what is strange is that it is explicitly stated that the tree is "binary" when in fact the statement dictates even tighter constraint.

Ivaylo Strandjev
  • 69,226
  • 18
  • 123
  • 176