an implementation of sorted set class in C++ using singly linked list.
-
SortedSet(); //default constructor
-
void insert(T const&); //inserts the data in such a way that the resulting set remains sorted. Duplicate data is not allowed
-
void delete_(int const&); //deletes the data at the given index.
-
void union_(SortedSet const&); //takes union of two sets.
-
void intersection(SortedSet const&); //takes intersection of two sets
-
void deleteAll(); //deletes all the elements in the set.
-
bool isEmpty() const; //returns true if the set is empty.
-
void print() const; //prints all the elements of the set.
-
~SortedSet(); //destructor
Note: None of the functions have any nested loop.