int search(int a[], int key, int low, int high) {
if (high < low) {
return NOT_FOUND;
}
int mid = (low + high) / 2;
if (key>a[mid]) {
return searchName(a, key,low, mid-1);
} else if (key<a[mid]) {
return searchName(a, key,mid+1, high);
} else {
return EXIT_SUCCESS;
}
return ERROR_SEARCH;
}
Now I want to make recursive one which just need
int search(char *dict, char *name,int length,int compChars)
and length is number element in array.
please help me.
This one work for all exit element but there is not condition to stop when element now exit!??
Please test it and help.I really need it before next midnight.