Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #ifndef PERSISTENT_BIN_TREE_SUPER_TREE_H
- #define PERSISTENT_BIN_TREE_SUPER_TREE_H
- #include "node.h"
- #include<memory>
- //#define const_iterator node*
- //#define MAX_STRING "ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ"
- const std::string MAX_STRING = "ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ";
- struct set {
- public:
- set();
- set(set const &);
- set(node const &);
- ~set();
- set & operator= (const set &);
- bool empty() const;
- void erase (value_type const&);
- void insert (value_type const&) ;
- bool contains (value_type const&) const;
- private:
- std::shared_ptr<node> erase (std::shared_ptr<node>, value_type);
- std::shared_ptr<node> insert (std::shared_ptr<node>, value_type const&);
- std::shared_ptr<node> find (std::shared_ptr<node>, value_type const&) const;
- std::shared_ptr<node> minimum (std::shared_ptr<node>) const;
- std::shared_ptr<node> maximum (std::shared_ptr<node>) const;
- std::shared_ptr<node> next (std::shared_ptr<node>, value_type const) const;
- std::shared_ptr<node> prev (std::shared_ptr<node>, value_type const) const;
- std::shared_ptr<node> root;
- size_t size_ = 0;
- };
- #endif //PERSISTENT_BIN_TREE_SUPER_TREE_H
- #ifndef PERSISTENT_BIN_TREE_NODE_H
- #define PERSISTENT_BIN_TREE_NODE_H
- #include<string>
- #include <memory>
- //#define value_type std::string
- typedef std::string value_type;
- struct node {
- node();
- node(value_type);
- node(node const &);
- node& operator= (const node&);
- std::shared_ptr<node> left;
- std::shared_ptr<node> right;
- value_type val;
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement