文件名称:search
-
所属分类:
- 标签属性:
- 上传时间:2012-11-16
-
文件大小:1.07kb
-
已下载:0次
-
提 供 者:
-
相关连接:无下载说明:别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容来自于网络,使用问题请自行百度
以深度为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).
所以,折半查找的平均时间复杂度为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
递归折半查找
递归折半查找/BinSearch2Main.cpp
递归折半查找
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.