The Gateway to Computer Science Excellence
0 votes
193 views
Consider a binary tree T that has 100 leaf nodes. Then the number of INTERNAL nodes in T that have exactly two children are ______.
in DS by Loyal (8.2k points) | 193 views
0
$99$?
0
if the binary tree is full.

1 Answer

+3 votes
Best answer

The number of INTERNAL nodes in the binary tree that have exactly two children is calculated as : number of leaf node -1.

you can verify it by some eg.

so for 100 node number of INTERNAL nodes that have exactly two children are 99.

by Boss (14.6k points)
selected by
0
Is it applicable to any type of binary tree?
+1
yes, it's true for all BT.

Related questions

Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true
50,654 questions
56,166 answers
193,872 comments
94,261 users