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
what is the work of 1tier,2tier,&ntier? Plz Explain it!
In project we have Documentation phase also,in that what is micro and macro designing?
Write a shell program. Enter number of days from keyboard. Find out the number of years, month and days it contains
it is a language or tools?
Is anyone has done the ASP.NET MVC4 workshop course(2 days) from Peers Technologies. Let me know. I need to talk before joining ASP.NET MVC4 training at peers, Hyderabad.
I'm new to ABAP. What is Module pool in SAP?
along with oracle which language will be beneficial to have knowledge with,java,.net,since i m doing oracle have appeared for 8th sem BEIT,plz suggest
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.
< DL Compact > tag is used for
what is apt_dump_score in datastage where it is useful
Mainly Related to Oracle, DBMS , Oracle Stored Procedures, Functions, Oracle 9i Architecture, Redo logs..., Views,
what is best way to create a Thread class & why?
they asked me about srs (software requirement specifcation)? how can i get anydocumentation about srs & other documnts infomation like bdd, in testing? its urgent?
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.
Given an array of size n, containing every element from 1 to n+1, except one. Find the missing element.