From 944b6759ff50473c23708cab02783583f96de5bf Mon Sep 17 00:00:00 2001 From: Matuush Date: Wed, 9 Apr 2025 10:31:47 +0200 Subject: [PATCH] Add append to treap structure --- treap.hpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/treap.hpp b/treap.hpp index 63f0c93..425c4ac 100644 --- a/treap.hpp +++ b/treap.hpp @@ -110,6 +110,9 @@ public: two.first = join(two.first, l); root = join(two); } + void append(string s) { + insert(size(), s); + } // Line removal void remove(count_type k) { auto two = split(root, k+1);