This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
There are many types of trees in programming, I am assuming that you are talking of a plain old binary tree.
I was thinking of the program and recalled the days when I was learning data structures for the first time
To start with, a tree node looks something like the following code.
Constructing tree is not much tricky as tree traversal is ;).
P.S The above quick code is inspired from my C/C++ way of doing it. There can be better way of doing it in Java.