#include using namespace std; void print_array(int a[],int size) { for (int i=0; ia[i+1]) { myswap(a[i],a[i+1]); swapped=true; } } } while(swapped); } int binarySearch(int a[], int size, int key) { int location=-1; // Searching range. int low=0, high=size-1; // Item to select. int selection=0; // Was the key found in the array. bool found=false; // First must be sorted. bubbleSort(a,size); print_array(a,5); cout << "Searching..." << endl; while(!found && low<=high) { selection=(low+high)/2; cout << selection << endl; if(a[selection]==key) { found=true; } // Look for a higher number if(key>a[selection]) { low=selection+1; } // Look for a lower number. else if(key