// Name: John H. Hacker // Assg: Program #4 - Sorting // Date: June 27, 2006 // Desc: This program implements a bubble sort and a selection sort // and demonstrates their use on a (relatively) large input file // of unsorted names. #include #include #include using namespace std; const int MAX_NAMES = 5000; // Prototypes for functions used in searching void display(string names[], int size); int input(string filename, string names[]); int main() { string names[MAX_NAMES]; int numNames; numNames = input("unsortednames.dat", names); cout << "The names that are in our database: " << endl; display(names, numNames); cout << endl << endl; } // display // // A simple function to display the values in an array of strings // We format the values onto standard output in a nice readable way // // Params: // names an array of strings whose values are to be displayed // size the number of values in the array void display(string names[], int size) { for (int i=0; i