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
I HAVE DONE TESTING TOOLS COURSE,NOW I AM FRESHER,I AM NOT GETTING ANY CALLS,I WANT TO DO THE PROJECT ,WHERE I HAVE TO MEET TO DO THE PROJECT,I AM GOING WITH FAKE EXPERIENCE,SO WHAT I HAVE TO DO.
smal talk is pure object oriented or not?
how can i split string in a textbox in windows appication using C#.net
i want to insert textbox value to sql db. i have only one text box but store four values. ple give any one give sample code in asp.net c#..
19. Given a system that is described with the following equation, X=A+(B.(A̅+C)+C)+A.B.(D̅+E̅) a) Simplify the equation using Boolean Algebra. b) Implement the original and then the simplified equation with a digital circuit. c) Implement the original and then the simplified equation in ladder logic.
In JCl , we have COND parameter.This holds comparison code and condition.It also has only and even parameters. ex: COND((4,GE),EVEN).what the comma mean here. is that 'and' or 'or'.
Which design patterns have you used?
how to hide prompts
Given: coordinates of rectangle-> left bottom and right top points. the rectangles create a hole.Find the maximum area of the hole. eg. 4 rectangles create a hole in between. find its area.
what is the BAM? where we can use it in BizTalk server?
is it acceptable if we declare multiple exceptions in same overridden method.
which worker is involved in all the phases of SDLC?
HOW TO FIND NUMBER OF TWOS IN N!(N FACTORIAL)??
Explain three modes in which files can be accessed from python program
what is meant by life cycle of a business