登录
首页 » Windows开发 » 以深度为k的满二叉树(n=2k

以深度为k的满二叉树(n=2k

于 2023-08-09 发布 文件大小:1.07 kB
0 19
下载积分: 2 下载次数: 1

代码说明:

以深度为k的满二叉树(n=2k-1)为例,假设表中每个记录的查找概率相等,即 pi=1/n(1≤i≤n),而树的第i层上有2i-1个结点,因此,折半查找的平均查找长度为: 所以,折半查找的平均时间复杂度为O(log2n)。 -To a depth of k over the binary tree (n = 2k-1) as an example, suppose the table to find the probability of each record the same, that is, pi = 1/n (1 ≤ i ≤ n), and the tree layer of the first i There are 2i-1 nodes, therefore, to find half the average length of search as follows: Therefore, to find half the average time complexity is O (log2n).

下载说明:请别用迅雷下载,失败请重下,重下不扣分!

发表评论

0 个回复

  • 696524资源总数
  • 103827会员总数
  • 23今日下载