Fix treap clear
This commit is contained in:
parent
a867520b0b
commit
8dfbc802d2
1 changed files with 2 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue