#include #include using namespace std; // Linear search will return the index position for // the value search for in the array. // If not found, -1 is returbed. int linear_search(int array[], int size, int value); int linear_search(int array[], int size, int value){ // Set the location where the value is found. // Default location is a "not found" position. int location=-1; // Search for the value at all the positions in the array. for(int i=0; iarray[i+1]) { myswap(array[i],array[i+1]); swapped=true; } } }while(swapped); } // array is array to search // size is the size of the array. // value is the value to search for. // // Returns the poisition of the value in the array. // -1 is returned if the value is not found. int mybinary_search(int array[],int size, int value) { // First make sure the array's values are sorted. bubble_sort(array,size); // Range points. int low, high, mid; low=0; high=size-1; // Searches while(high>=low) { mid=(low+high)/2; // Value is found if(value==array[mid]) return mid; // if midpoint value is too low. else if(value>array[mid]) low=mid+1; // if midpoint value is too high. else if(value