#include "List.h" template class SortedList // ASSUMPTIONS ON type T: // 1) elements of type T can be compared with operators < and == // 2) T should not be int, otherwise items get mixed with indexes!!! // NOTE: in c++ there is no tool how to specify such requirements // on s template parameter { private: // add your data members here: public: // do not modify: SortedList(); // constructor bool isEmpty() const; // Determines whether a list is empty. // Postcondition: Returns true if the list is empty, otherwise returns false. int size() const; // Determines the length of a list. // Postcondition: Returns the number of items that are currently in the list. void removeAll(); // Deletes all the items from the list. // Postcondition: The list is empty. void add(int i, const T& item); // Postcondition: The size of the list is incremented by 1 and the // the number of elements ‘item’ has increased by 1. The parameter i // should be ignored. Should not throw any exception const T& get(int i) const throw(ListIndexOutOfRangeException); // Precondition: 1 <= i <= size() // Postcondition: The i-th smallest item in the list is returned. // Throws: ListIndexOutOfRangeException if index < 1 or // index > size(). void remove(int i) throw(ListIndexOutOfRangeException); // Precondition: 1 <= i <= size() // Postcondition: The i-th smallest item in the list is removed // from the list. // Throws: ListIndexOutOfRangeException if index < 1 or // index > size(). void remove(const T& item); // Precondition: none // Postcondition: All occurrences of ‘item’ are removed from the list. int count(const T& item) const; // Precondition: none // Postcondition: Returns the number of occurrences of ‘item’ // in the list. }; // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! // Provide definitions of all methods here: // for instance: // template // void SortedList::size() const // { // return num_items; // }