The Gateway to Computer Science Excellence
+1 vote
370 views

A full binary tree with $n$ leaves contains

  1. $n$ nodes 
  2. $\log_{2} n$ nodes 
  3. $2n –1$ nodes
  4. $2^{n}$ nodes 
in Algorithms by Boss (30.8k points)
recategorized by | 370 views

2 Answers

+3 votes
Best answer

Answer : 2n-1 nodes

A full binary tree  is a tree in which every node other than the leaves has two children

       

No of leaves No of nodes  Result
first diagram has 2 leaves  total no of nodes is 3  2n - 1  = 2*2 - 1 = 3
second diagram has 4 leaves  total no of nodes is 7  2n - 1 =  2*4 - 1 = 7 
third diagram has 8 leaves   total no of nodes is 15  2n - 1 = 2*8 - 1 = 15
by Boss (45.4k points)
selected by
+3 votes

Ans C

A full binary tree with nn leaves contains n-1 internal nodes.

Total nodes= internal nodes + leaves = n-1 + n

= 2n-1

by Boss (33k points)
Answer:

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,737 questions
57,385 answers
198,560 comments
105,390 users