This week's book giveaway is in the General Computing forum.
We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line!
See this thread for details.
The moose likes Java in General and the fly likes Help me please with Java binary tree Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "Help me please with Java binary tree" Watch "Help me please with Java binary tree" New topic
Author

Help me please with Java binary tree

Ahrumi Lee
Greenhorn

Joined: Jul 15, 2004
Posts: 6
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?
Nicolaas van Rensburg
Greenhorn

Joined: Jul 16, 2004
Posts: 8
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?
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Help me please with Java binary tree
 
Similar Threads
How to make a binary tree in JSP?
Java in data structures and linked list
how do i solve this recorsive function question??
tree with check box.
JSF Tree with check box