diff --git a/treap.hpp b/treap.hpp index e4636f5..2c7fbf7 100644 --- a/treap.hpp +++ b/treap.hpp @@ -1,6 +1,7 @@ #include #include #include +#include using std::string; typedef unsigned long long count_type; @@ -91,11 +92,10 @@ public: } void clear() { while(size() > 0) { - auto two = split(root, 0); + auto two = split(root, 1); root = two.second; delete two.first; } - root = nullptr; } // Line insert