文件名称:FindStringInSortedArray
-
所属分类:
- 标签属性:
- 上传时间:2012-11-16
-
文件大小:1005byte
-
已下载:0次
-
提 供 者:
-
相关连接:无下载说明:别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容来自于网络,使用问题请自行百度
通过递归实现二分法,以递归的方式能快捷直接的实现平时要比较麻烦的二分法查询功能-// Function: FindStringInSortedArray
// Usage: index = FindStringInSortedArray (key, array, n)
// -------------------------------------------------------------
// The function searchs the array looking for the specified key.
// The argument n specifies the effective size of the array, which must
// be sorted according to the lexicographic order imposed by StringCompare.
// If the key is found, the order imposed by StringCompare. If the key is found, the order imposed by
// StringCompare. If the key is found, the function returns the index in the array at which that key appears.
// (If the key appears more than once in the array, any of the mathcing indices may be returned). If the key
// does not exist in the array, the funcion returns-1. In this implementation, FindStringInSortedArray is simply
// a wrapper all the work is done by the recursive function BinarySearch.
// Usage: index = FindStringInSortedArray (key, array, n)
// -------------------------------------------------------------
// The function searchs the array looking for the specified key.
// The argument n specifies the effective size of the array, which must
// be sorted according to the lexicographic order imposed by StringCompare.
// If the key is found, the order imposed by StringCompare. If the key is found, the order imposed by
// StringCompare. If the key is found, the function returns the index in the array at which that key appears.
// (If the key appears more than once in the array, any of the mathcing indices may be returned). If the key
// does not exist in the array, the funcion returns-1. In this implementation, FindStringInSortedArray is simply
// a wrapper all the work is done by the recursive function BinarySearch.
(系统自动生成,下载前可以参看下载内容)
下载文件列表
FindStringInSortedArray.c
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.