Variant of problem 10.1

#1

The variant for problem 10.1 is stated as:

“Write a program that returns the size of the largest subtree that is complete.”

To clarify:

For each node v in a tree, is the tree rooted at v considered a subtree ?

Does complete mean that all levels of the tree are full, except for the last level, which is filled from the left to right ?

Is the question asking for a node ‘v’ in the tree (with the tree rooted at ‘v’) satisfying the complete property and having the largest number of elements contained in it ?

It would helpful if you could provide more information about this problem as well as some tips, suggestions, skeleton solution.

Thanks!

0 Likes

#2

Hi @maverick99,

Basically every node in a tree is consider a subtree, and for complete, we have defined in the introduction part of the book, you can check the definition of that.

0 Likes