From 52cae605f443e7b3e165ddcdd880d5c8e5fff835 Mon Sep 17 00:00:00 2001 From: Paul Jungeblut Date: Sun, 19 Mar 2017 15:58:59 +0100 Subject: Slight changes to suffix tree and adding implicit cartesian STL tree. --- datastructures/stlRope.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 datastructures/stlRope.cpp (limited to 'datastructures/stlRope.cpp') diff --git a/datastructures/stlRope.cpp b/datastructures/stlRope.cpp new file mode 100644 index 0000000..9179a60 --- /dev/null +++ b/datastructures/stlRope.cpp @@ -0,0 +1,8 @@ +#include +using namespace __gnu_cxx; +rope v; // Wie normaler Container. +v.push_back(num); // O(log(n)) +rope sub = v.substr(start, length); // O(log(n)) +v.erase(start, length); // O(log(n)) +v.insert(v.mutable_begin() + offset, sub); // O(log(n)) +for(auto it = v.mutable_begin(); it != v.mutable_end(); it++) {...} -- cgit v1.2.3