Fix treap clear

This commit is contained in:
Matúš Púll 2025-04-15 16:46:18 +02:00
parent a867520b0b
commit 8dfbc802d2

View file

@ -1,6 +1,7 @@
#include <string>
#include <cstdlib>
#include <utility>
#include <iostream>
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