首页| JavaScript| HTML/CSS| Matlab| PHP| Python| Java| C/C++/VC++| C#| ASP| 其他|
购买积分 购买会员 激活码充值

您现在的位置是:虫虫源码 > 其他 > 以深度为k的满二叉树(n=2k

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

  • 资源大小:1.07 kB
  • 上传时间:2021-06-30
  • 下载次数:0次
  • 浏览次数:0次
  • 资源积分:1积分
  • 标      签: Windows开发 深度 满二叉 NK

资 源 简 介

以深度为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).

文 件 列 表

递归折半查找
BinSearch2.cpp
BinSearch2Main.cpp
VIP VIP
0.168651s