Skip to content

Commit 92bc623

Browse files
Simplify treap insert (#281)
1 parent 0f8a6aa commit 92bc623

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

content/data-structures/Treap.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ Node* merge(Node* l, Node* r) {
5454
}
5555

5656
Node* ins(Node* t, Node* n, int pos) {
57-
auto pa = split(t, pos);
58-
return merge(merge(pa.first, n), pa.second);
57+
auto [l,r] = split(t, pos);
58+
return merge(merge(l, n), r);
5959
}
6060

6161
// Example application: move the range [l, r) to index k

0 commit comments

Comments
 (0)