about ordered tree and its features
I have read a lot and I could not get what does ordered tree mean? would you explain me w开发者_JAVA技巧ith some examples thanks!
An ordered tree contains nodes (elements) which can be ordered according to a specific criteria. Often it is a binary tree, i.e. nodes have at most two children (conveniently called the left and right child). The tree is ordered when at every node, all elements in its left child tree are smaller than elements in its right subtree (and if the non-leaf node itself contains an element, it is greater than the elements in the left subtree and less than the elements in the right subtree).
(provided all elements in the tree are unique - if not, then some "greater than" / "less than" above becomes "greater or equal to" / "less or equal to".)
Simple example:
4
/ \
2 6
/ \ / \
1 3 5 7
Here is a more detailed explanation.
At this site, it is explained with some figures:
http://planetmath.org/orderedtree
精彩评论