Implementation of Binary Search
Write a C program to implement Binary Search Algorithm. Include a function int BinarySearch (int, int, int *, int x) --- The 1st parameter is the lower limit of the list or array, the 2nd parameter is the upper limit of the list or array, the third parameter is a pointer to the array and the fourth parameter is the search element. The index of the search element is returned by the function. If the search element is not present in the array, -1 is returned.
Function Definitions: int BinarySearch (int l, int h, int * a, int x)
Aucun commentaire:
Enregistrer un commentaire