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

preorder of A*(B+C)/D-G

6 Answers   BFL,


Explain the difference between an expert and a novice user. How would your strategy for designing user interfaces for an expert user differ from that for designing user interfaces for a novice user.

0 Answers  


What r the attributes using in Win Runner?

0 Answers   Tavant Technologies,


How does the type system works when there is interoperability between a COM and .Net, i mean what exactly happens there

0 Answers   247Customer,


What is the worst case of AVL tree?

1 Answers  






hii I inntrested abt scjp certification but i dont knw abt scjp plz send details abt scjp exam and syllabus.

0 Answers  


What are the limitation in using querystring in .net?

1 Answers   Tesco,


code for connection from windows forms to sql server

0 Answers   ME,


THE CHANNEL IN DATA COMMUNICATION CAN BE?

0 Answers   TCS,


Is CTS company do serious backgroung check?

0 Answers   CTS,


you have a computer with 80GB hard disk and ubuntu 8.04 is installed on entire hard disk.now you have to create a seprate partition for windows OS and install win XP as dual boot.write down the steps involved along with the commands

1 Answers   Anand Group, Indian Navy, TCS,


What do you understand by modular programming?

0 Answers   Tech Mahindra,


Categories