I have to make a function of binarytree class.
function will return the level with maximum number of nodes.
I m using the Linked representation of binary tree.
Printable View
I have to make a function of binarytree class.
function will return the level with maximum number of nodes.
I m using the Linked representation of binary tree.
If the tree is complete, the last level should have the max nodes.. If the pre condition is that it may or maynot be complete, then ur going to have to do it in recursion.. Cant give u the specific code though cause i havent done binarytrees in a long ass time.
and your question is exactly what?
If you had generated the full functional binary tree , it would just be a matter for tree traversal.You have to design a method for tree traversal that would assist in finding the number of nodes on each level.
I can get you the code but give the detailed specification on how are you implementing the program?