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

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

how to add Servlet-api.jar file into eclipse 3.3.2 ?

4298


in teradata level primary in table level allows duplicates why?

1845


Write a program to find whether a given number is prime or not.

791


what is an INI file?

1859


when we use mantis? how learn mantis?

1910


in IBM PC -AT.WAT AT REFERS TO?

1643


Find out the list of roles which gives access to GUI activities? thanks in advance

1924


Write a program that prints the numbers from 1 to 100. But for multiples of three print "Fit" instead of the number and for the multiples of five print "Bit". For numbers which are multiples of both three and five print "FitBit".

2176


hai i am prasanna.I am MCA 2009 fresher.tell me about certifications.which certification helps me to improve my carrier and to get a technically oriented job ,which certification helps to get job faster.

2212


What is the difference beween joblib and steplib statements

2016


Find out the list of authorization objects which contains activity as a field? Thanks in advance.

1982


Given a Binary Search Tree, write a program to print the kth smallest element without using any static/global variable. You can?t pass the value k to any function also.

789


Diff between IF and where ?

1778


what is the last ant version you worked?how to get it

1696


Write a shell program where you enter a number which corresponds to K.M. Find out the corresponding values in m, cm, inches, and feet. Hints:- 1 k.m= 1000 m 1 m= 100 cm 1 inches= 2.54 cm. 1 feet= 12 inches

1749