From 8dfbc802d2e9ffc79cf22903eb18655d85509504 Mon Sep 17 00:00:00 2001 From: Matuush Date: Tue, 15 Apr 2025 16:46:18 +0200 Subject: [PATCH] Fix treap clear --- treap.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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