#ifndef INTMEAP_H #define INTMEAP_H #include class IntMeap { public: class AccessingEmptyMeapException { }; typedef std::vector container_type; typedef std::vector::const_iterator const_iterator; typedef std::vector::iterator iterator; typedef size_t index_type; void insert( int value ); int top() const; void pop(); bool empty() const; size_t size() const; const_iterator begin() const; iterator begin(); const_iterator end() const; iterator end(); /** * Return an iterator pointing to the left child of the node pointed to * by the supplied iterator, or to end() if the node has no children. */ const_iterator left_child( const_iterator it ) const; /** * Return an iterator pointing to the right child of this node's parent. * The supplied iterator must be to a left child. If there is no right * child, return end(). */ const_iterator right_sibling( const_iterator it ) const; private: container_type values_; }; #endif