// Linear search of an array. #include using std::cout; using std::cin; using std::endl; #include #include "searchArray.h" #include "sortArray.h" int main() { const int arraySize = 100; // size of array a int a[ arraySize ]; // create array a int searchKey; // value to locate in a for ( int i = 0; i < arraySize; i++ ){ // create some data a[ i ] = 1 + rand() % arraySize ; cout<> searchKey; // ordina la matrice bubbleSort( a, arraySize ); // attempt to locate searchKey in array a int element = binarySearch( a, searchKey, 0, arraySize - 1, arraySize ); // display results if ( element != -1 ) cout << "Valore trovato nell'elemento " << element << endl; else cout << "Valore non trovato" << endl; return 0; // indicates successful termination } // end main