Question: a. Write a recursive method that computes the number of null pointers in a binary tree. public int numberofnullPointers (BinaryNode tree); b. Let n be

 a. Write a recursive method that computes the number of null

a. Write a recursive method that computes the number of null pointers in a binary tree. public int numberofnullPointers (BinaryNode tree); b. Let n be the number of nodes in a binary tree. Prove by induction on n that the number of null pointers in a non-empty binary tree equals n+1. (Hint: What is P(n) ? Do not begin to write a proof until you have defined what P(n) is.)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!