mirror of
https://git.sb/baoshuo/OI-codes.git
synced 2024-12-02 19:36:30 +00:00
parent
a0dbc85ede
commit
f20fed1f24
@ -87,7 +87,6 @@ std::pair<Treap::node *, Treap::node *> Treap::splitByValue(Treap::node *p, int
|
|||||||
Treap::node *Treap::merge(Treap::node *x, Treap::node *y) {
|
Treap::node *Treap::merge(Treap::node *x, Treap::node *y) {
|
||||||
if (x == nullptr) return y;
|
if (x == nullptr) return y;
|
||||||
if (y == nullptr) return x;
|
if (y == nullptr) return x;
|
||||||
if (x->val > y->val) std::swap(x, y);
|
|
||||||
if (x->key > y->key) {
|
if (x->key > y->key) {
|
||||||
x->right = this->merge(x->right, y);
|
x->right = this->merge(x->right, y);
|
||||||
x->pushup();
|
x->pushup();
|
||||||
|
Loading…
Reference in New Issue
Block a user