0

I am not a computer programmer but I need this idea for one of my projects. I would explain what I am trying to achieve:

These are two pictures picture picture. Can we write a code to find the number of nodes whose both children are the terminal node? If yes then I would spend the time to form the algorithm or I may try to achieve it in some other way.

If achieved, the answer to my problem would be 3 (1+2), based on above pictures.

NOTE : 1) This are Full Binary tree. 2) There are many more trees. 3) I am Using Python

RAAS
  • 1
  • 1
  • Check out https://stackoverflow.com/questions/21004181/how-to-get-leaf-nodes-of-a-tree-using-python – wuarmin Dec 05 '18 at 07:37
  • 2
    Possible duplicate of [How to find the lowest common ancestor of two nodes in any binary tree?](https://stackoverflow.com/questions/1484473/how-to-find-the-lowest-common-ancestor-of-two-nodes-in-any-binary-tree) – veben Dec 05 '18 at 07:39

0 Answers0