• Post Reply Bookmark Topic Watch Topic
  • New Topic

Finding height of tree and depth of nodes in huffman tree  RSS feed

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi.I'm trying to obtain the height of my tree and the depth of every node in a huffman tree.
I have been trying different method to obtain the height but it's still not working.
My method is height(HuffmanNode n).
I can't figure out whats the problem.
Please, I'm stuck on that.

 
Saloon Keeper
Posts: 4051
48
Eclipse IDE Firefox Browser Java MySQL Database VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please enclose source code listings inside "Code" tags. Highlight the code and click on the button marked "Code" just above the edit box. I fixed it for you this time.
 
Marshal
Posts: 58302
178
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please write down what the algorithm looks like; we can only help if we know the full details. Similarly, tell us what is going wrong.
 
Knight Ramsamy
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's my main method.

 
Campbell Ritchie
Marshal
Posts: 58302
178
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Apart from the fact that the ideal length of a main method is one statement: please explain the algorithm. Until you know what you are trying to do, you cannot work out how to do it. Please show us the algorithm rather than code.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!