函数模版:
template<typename T>
int binary_search (T arr[], int size, T target) ;
参数说明:
T: 模版参数
arr : 数组首地址,
size: 数组元素个数,
T target : 需要查找的值
返回值: 如果数组中找到target, 返回其下标
否则返回 -1
要求数组元素顺序非递减
template
<
typename T
>
int
binary_search (T arr[],
int
size, T target)
template<typename T>
int binary_search (T arr[], int size, T target) ;
参数说明:
T: 模版参数
arr : 数组首地址,
size: 数组元素个数,
T target : 需要查找的值
返回值: 如果数组中找到target, 返回其下标
否则返回 -1
要求数组元素顺序非递减

