// File IndxList.h #ifndef INDEX_LIST_H_ #define INDEX_LIST_H_ template class index_list { public: // Constructor index_list (); // Add an item to the end of an indexed list int append (const T&); // IN: item appended // Insert an element at a specified index int insert (int, // IN: insertion index const T&); // IN: item inserted // Retrieve an element at a specified index int retrieve (int, // IN: index T&) const; // OUT: value retrieved // Delete an element at a specified index int remove (int); // IN: index // Find index of smallest value in a sublist int find_min (int, // IN: start index int) const; // OUT: end index // Find index of largest value in a sublist int find_max (int, // IN: start index int) const; // OUT: end index // Find index of a target item // Returns -1 if target item not found int search (const T&) const; // IN: target item // Sort an indexed list void sel_sort (); // Read data into the list void read (); // Display the list contents void display () const; // Get the current size int get_size () const; private: //Functions ... void exchange (int, // IN: index of first element to be exchanged int); // IN: index of second element to be exchanged //Data Members T elements[max_size]; // Storage for elements int size; // Count of elements in list }; #endif // INDEX_LIST_H_