PDA

View Full Version : A Binary Tree question



nabeelisnabeel
01-14-2006, 03:38 AM
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.

erRor67
01-15-2006, 07:59 PM
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.

JuicyPork
01-22-2006, 06:41 AM
and your question is exactly what?

cools
04-08-2006, 07:43 PM
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?