• Post Reply Bookmark Topic Watch Topic
  • New Topic

Help me please with Java binary tree  RSS feed

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm struggling with simple java codes..could anyone please help me with these two problems?

Given a binary tree that has integers (this is not a binary tree that is ordered properly), what code will find the maximum element?
 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The first option that is available to you, is logiacally sorting the tree and then transversing, moving through, the array.

If you want to avoid sorting the tree, you can search through your Object, Vector etc. What are you using to store the tree in?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!