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 |
what are other resources are needed for this mantis?
Suppose we are doing 4 operations on database using service, first operation is successful but due to some reason remaining 3 operations are failed. I) is this transaction successful or not? ii) How can you give that error message to user?
why rownum=1 works properly but not rownum=>2,=>3 etc.
Write a shell program to test whether a given year is leap year or not ?
DIFFERENCE BETWEEN BINDING LANG AND BIND DIR WHEN USING IN SERVICE PGM
what is posix?
in a company 30% are supervisors and 40% employees are male if 60% of supervisors are male. what is the probability that a randomly choosen employee is a male or female?need steps to solve this?
Can i please VHDL code for D-Latch with clear input ?? (HINT: Set up a “Process” with appropriate sensitivity list to get the desired D-Latch with Clr working.) Inputs and Outputs: entity Lab4b is Port ( Clr, Clk, D : in STD_LOGIC; Q : out STD_LOGIC); end Lab4b;
How to display questions one by one in jsp and I wants to store the answers in my database?
What function would you use to extract characters from a given string?
swap two number wthout using third variable
Given an array of size n. It contains numbers in the range 1 to n. Each number is present at least once except for 1 number. Find the missing number