#include #include #include #include struct InfoType { int id; int inv; }; struct StoreType { apvector vect; int Number; }; //=========================================================== void quickSort (apvector &list, int first, int last); void swap(int a, int b, apvector &vect) { apvector temp(2); temp[1] = vect[a]; vect[a] = vect[b]; vect[a] = temp[1]; } void search(); //======================================================= void main() { InfoType Info; StoreType List; int j=0; int first=0; int last=19; //------------------------------------ ifstream infile ("C:\\FILE50.txt",ios::in); if (infile.fail()) cerr<<"did not open corectly"<>List.Number; List.vect.resize(List.Number); for(int loop=0;loop>List.vect[loop].id; infile>>List.vect[loop].inv; } //---------------------------------- quickSort(List.vect,first,last); while(j &list, int first, int last) { int g = first, h = last; int midIndex, dividingValue, temp; midIndex = (first + last) / 2; dividingValue = list[midIndex].id; do { while (list[g].id < dividingValue) g++; while (list[h].id > dividingValue) h--; if (g <= h) { swap(g, h, list); g++; h--; } } while (g < h); if (h > first) quickSort (list,first,h); if (g < last) quickSort (list,g,last); } void search() { int prodid; cout<<"what is the ID of the item you are looking for"; cin>>prodid; for(int loop=0; loop<20; loop++) { if(List.vect[loop].id==prodid) { cout<<"there are "<