简体   繁体   English

最佳二叉搜索树-Cormen

[英]Optimal binary search tree - Cormen

在此处输入图片说明

I am looking into optimal binary search tree in Introduction to Algorithms by Cormen etc. For reference I am attaching a text link . 我正在研究Cormen等人的《算法导论》中的最佳二叉搜索树。作为参考,我附加了一个文本链接

Here on page 399 we have table which has contribution. 在第399页的此处,我们有一个有贡献的表格。 I am not able to understand how author calculated this column. 我无法理解作者如何计算此列。 For example node k1 contribution is 0.30, k4 is 0.20. 例如,节点k1贡献为0.30,k4为0.20。 How has the author calculated this? 作者如何计算的?

Look at the formula to get search cost in T => E[search cost in T]=.... (page 398 the bottom) 看一下公式,得出T中的搜索成本=> E [T中的搜索成本] = .... (第398页的底部)

To get cost for k1: 要获得k1的费用,请执行以下操作:

k1=(depth(k1) + 1) * p1

Look at the table is given for value of depth(k1) and p1 (page 399) . 请看下表,以获取depth(k1)和p1的值(第399页)

k1=(1+1)*0.15
  =2*0.15
  =0.3

k2=(0+1)*0.10
  =1*0.10
  =0.10

etc

I hope my explanation can help. 希望我的解释能对您有所帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM