If you understand the concept then an implementation isn't terribly difficult with a little effort on your part. So go do your own homework. We won't bail you out. kthxbye.
any simple example?
No. In my experience, people asking for "simple" examples of something reasonably complex don't understand the simplest example possible and then continue to ask for explanations and excessive hand holding. It's a waste of time to type up the example in the first place, so I don't do it anymore unless you show promise.
This is a very basic example. Then you must implement the addNode, traverseTree, searchTree
and other functions to use the structure. When implementing a tree you will need a lot of recursion or stack in order to traverse, search and to use other features that tree offers.
Even the most basic of basic examples will use an array to store links. Once you get beyond two links (even there an array is helpful), it becomes exponentially more tedious to work with nodes. Just an FYI.
Since I generally use binary trees it is a habit for me to declare the pointers seperately.
I did that for a while before realizing that it's cleaner to use an array even for binary trees. Instead of manually writing two symmetric cases for the left and right link, you can roll that up into one case and use a simple calculation to determine which index you want. I've found this to be absolutely invaluable when the symmetric cases start getting larger, such as with balanced binary search trees.