7.4比较树(国外英语资料).doc

  1. 1、本文档共13页,可阅读全部内容。
  2. 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
  3. 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  4. 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
7.4比较树(国外英语资料)

7.4比较树(国外英语资料) (also called decision tree algorithm of tree or search trees), the method is that the tracking algorithm, using tree nodes (we use the circle) to describe each key comparison. In the loop we place the index of the keys that are compared to the target key. The branch (line) is drawn down by the position of the circle, indicating the result of the comparison, and then marked as before. When the algorithm is over, we place the no or the target key in the appropriate branch. Were going to call it the leaf, in square. The leaf is sometimes called the tail or outer node of the tree. The remaining nodes are called inner nodes of the tree. The comparison tree in the order lookup is especially simple, which is shown in figure 7.2. A specific search algorithms do more times, is from the top of the tree (we call it the root) to an appropriate leaf within all traversal path between node number. The number of branches that are traversed from the root node to a node is called the height of the node. So the height of the root node is 0, and the height of the node that appears below it is 1, and so on. The total number of nodes on the longest path in the tree is called the height of the tree. So a tree with only one node has a height of 1. In the following sections, we sometimes encounter empty trees, which are not nodes in the tree. We use the following rule that the height of an empty tree is 0. In order to complete the term, when we use tree traditionally, we use the family tree tree metaphor biological: we call under immediate node node v v child, v node immediately above the node is called the parent v. So we can call it the parent of the leaf or the child of the root. Analyze the tree at n = 10 1. The shape of the tree On average, the number of comparisons to be done in each sequence is far more than binary search. This is evident in the comparison of the shape of their trees. Figure 7.3 and 7.4 are the trees of binary_search_1 and binary_search_2. The tree is

您可能关注的文档

文档评论(0)

f8r9t5c + 关注
实名认证
内容提供者

该用户很懒,什么也没介绍

版权声明书
用户编号:8000054077000003

1亿VIP精品文档

相关文档