2014年2月14日星期五

Binary tree

There is at most 2 children on each node(left children and right children if exists), the degree of each node can be at most 2. Path is a sequence of nodes n1...nk, where there is an edge from ni to ni+1. The length of a path is the number of
edges in it and there is only a unique path from the root to each node.

Binary tree can be combine with recursion to search value by using either pre-order traversal,in-order traversal or post-order traversal. The difference is the order of meeting the root. And is no cycles -- no path from the loop.
Binary Tree

没有评论:

发表评论