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
how to add Servlet-api.jar file into eclipse 3.3.2 ?
in teradata level primary in table level allows duplicates why?
Write a program to find whether a given number is prime or not.
what is an INI file?
when we use mantis? how learn mantis?
in IBM PC -AT.WAT AT REFERS TO?
Find out the list of roles which gives access to GUI activities? thanks in advance
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".
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.
What is the difference beween joblib and steplib statements
Find out the list of authorization objects which contains activity as a field? Thanks in advance.
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.
Diff between IF and where ?
what is the last ant version you worked?how to get it
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