正在加载图片...
查找函数设计如下 int Seqsearch(Data Type all, int n, Key Type key) inti=0 while(i< n & ai key !=key)i++ if(ai]. key=- key) return i; else return -l 查找成功时的平均查找长度ASL为: ASL=∑PC1=∑=(n+1)/2查找函数设计如下: int SeqSearch(DataType a[], int n, KeyType key) { int i = 0; while(i < n && a[i].key != key) i++; if(a[i].key == key) return i; else return -1; } 查找成功时的平均查找长度ASL为:   = = = = = + n i i n i i i n n ASL PC 1 1 ( 1)/ 2 1
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有