Rotate image (square matrix) by 90 deg
Tue, 06 May 2025
Given a Binary Tree with n Nodes (you may arrange these nodes any way you want to). How many NULL pointers will be there ?
You want options also :)..
Here are the options
A) n B) n+1 C) n-1 D) None
The Answer is n+1.
No matter how you arrange n nodes in a binary tree, there will always be n+1 NULL pointers. for example, if n=3, then below are the possible arrangements of a Binary tree with 3 nodes, all the arrangements have 4 NULL pointers (marked 1,2,3,4)

You may try with any number of nodes in the tree, there will always be n+1 NULL pointers in a Binary tree with n Nodes.
Tue, 06 May 2025
Tue, 06 May 2025
Tue, 06 May 2025
Leave a comment