#ifndef __SET_HPP #define __SET_HPP #include "llist.hpp" template class Dictionary> class Set : Dictionary { using D = Dictionary; public: bool empty() const { return D::keys().empty(); } bool insert(T const& x) { return D::add(x, true); } bool remove(T const& x) { return D::remove(x); } bool contains(T const& x) const { return D::lookup(x) != nullptr; } LinkedList elements() const { return D::keys(); } }; #endif