if there are n nodes in a binary tree, how many null
pointers are there?
Answers were Sorted based on User's Feedback
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 |
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 |
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 |
In loading programs into memory, what is the difference between load-time dynamic linking and run-time dynamic linking?
I would like to know what is Intellimatch and some interview questions which could be asked related to Intellimatch.
which book we learned this mantis? how many version are realsed this mantis upto now?
How to set on/off a group of indicators in a single statement?
How does the TCP handle the issue of multiplexing?
how pseudo column works?
how many languages .net is supporting now?
What do you meant by Runtime Polymorphism?
What is the purpose of <Trigger> element of <updatePanel> in Ajax
which worker is involved in all the phases of SDLC?
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