It does matter!

Ignoring the arrow directions, assume that you don't know the exact root node of the Binary tree given above.

What is the number of all the possible Binary trees that it can be?

Clarifications:

  • You can not add or remove any link between any pair of nodes.

  • Arrows in the tree above indicates parent to child connection but ignore the arrows and take them only as a connection.


The answer is 7.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

2 solutions

Vighnesh Raut
Jul 5, 2018

A root node cannot have 3 3 connections in Binary Tree. So, for each node, assume that node to be root and check if it has 2 2 or less children. Only 7 7 of the nodes satisfy.

Aravind Vishnu
May 15, 2016

Just counting the number of vertices with degree strictly less than 3.

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...