Question

C++ DATA structure Exercise 6.1. Prove that a binary tree having n ≥ 1 nodes has...

C++ DATA structure Exercise 6.1. Prove that a binary tree having n ≥ 1 nodes has n − 1 edges.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

`Hey,

Note: Brother in case of any queries, just comment in box I would be very happy to assist all your queries

Consider the tree with n vertices. To Prove: The number of vertices will be n-1.

Assume P(n): Number of edges = n-1 for the tree with n vertices. n will be natural number.

P(1): For one node, there will be zero edges, since there is no other node to connect with.

P(2): For two nodes, Number of edges = n-1 = 2-1 = 1, since one edge is sufficient to connect two nodes in a tree.

...

Assume P(n) is true, i.e. for n number of vertices in a tree, number of edges = n-1.

Now, For P(n+1),

the number of edges will be (n-1) + number of edges required to add (n+1)th node.

Every vertex that is added to the tree contributes one edge to the tree.

Thus, the number of edges required to add (n+1)th node = 1.

Thus the total number of edges will be (n - 1) + 1 = n -1+1 = n = (n +1) - 1.

Thus, P(n+1) is true.

So, Using Principle of Mathematical Induction, it is proved that for given n vertices, number of edges = n - 1.

Kindly revert for any queries

Thanks.

Add a comment
Know the answer?
Add Answer to:
C++ DATA structure Exercise 6.1. Prove that a binary tree having n ≥ 1 nodes has...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT