if there are n nodes in a binary tree, how many null
pointers are there?

Answers were Sorted based on User's Feedback



if there are n nodes in a binary tree, how many null pointers are there? ..

Answer / anand prakash

If there are n nodes in a Binary Tree then number of null
pointers = n+1

Is This Answer Correct ?    58 Yes 5 No

if there are n nodes in a binary tree, how many null pointers are there? ..

Answer / fakkad

maximum(for complete binary tree) n+1

so total null pointers are <=n+1

It is equivalent to total number of leaf nodes.

Is This Answer Correct ?    8 Yes 3 No

if there are n nodes in a binary tree, how many null pointers are there? ..

Answer / sreenatha

let the binary tree be not symmetric , then it has n-1 edges
excluding the edges from deficient nodes(nodes that have
atmost one child) to NULL.
Suppose , the binary tree was perfectly symmetric (i.e,
every node including the root has exactly two children).
Then , the total no.of edges including the edges from leaf
nodes to NULL would be 2 * N .
So , required ans = 2*N - N-1 = N+1

Is This Answer Correct ?    8 Yes 3 No

if there are n nodes in a binary tree, how many null pointers are there? ..

Answer / banti sharma

Anand Prakash is Absulutely right

Is This Answer Correct ?    6 Yes 5 No

Post New Answer

More Programming Languages AllOther Interview Questions

In loading programs into memory, what is the difference between load-time dynamic linking and run-time dynamic linking?

0 Answers  


I would like to know what is Intellimatch and some interview questions which could be asked related to Intellimatch.

3 Answers  


which book we learned this mantis? how many version are realsed this mantis upto now?

0 Answers  


How to set on/off a group of indicators in a single statement?

0 Answers  


How does the TCP handle the issue of multiplexing?

0 Answers  


how pseudo column works?

0 Answers   Oracle,


how many languages .net is supporting now?

2 Answers  


What do you meant by Runtime Polymorphism?

2 Answers   Persistent,


What is the purpose of <Trigger> element of <updatePanel> in Ajax

0 Answers  


which worker is involved in all the phases of SDLC?

1 Answers  


What is the difference between an EXE and a DLL?

3 Answers   ABC, Hykin Solutions, Infoedge, Infosys, Polaris,


needs examples for black box testing and white box testing

1 Answers   CTS, IBM, Wipro,


Categories