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 |
what will we require to build project with the help of oracle
i need informatica certification dumps(S-powercenter 8 mapping designer)......plz fwd it to my mail id:gaya1989@yahoo.com
what is web configuration file
I want to pass .pdf files as OlE Object to crystal report through VB6. Please any one guid me...
how do i add a column dynamically in a table by using java application?
What is the best action a system can take when deadlock is detected
i want to open a helkp file that is txt file on link buttons click
What is a singleton linked list?
Write a program to show polymorphism.
what is difference between scripts, smartforms and adobe forms
How many types of list exist in the HTML
what are importance in problem tracking