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 |
When we have two versions of the dot net installed how does the compiler know which version of DLL it has to select to an application.
Corillian's product is a "Component Container." Name at least 3 component
how we can call xml file in java file using Android platform?
how many types of operating system are avaliable?
Code for display the images from drive using vb 6.0?
if 3 duplicate records, by keeping one original and one duplicate record, and how to delete remaining 2 duplicates in sql server 2008
To sorting array of 10 elements which sorting is best a)selection b)bubble c)tree sort
Difference between HTML and DHTML?
Write a program to find duplicate number from array in minimum time complexity.
can we allocate memory for interface? if no then why?
Given an array of size n. It contains numbers in the range 1 to n. Each number is present at least once except for 2 numbers. Find the missing numbers.
Is CTS company do serious backgroung check?