summaryrefslogtreecommitdiff
path: root/datastructures/stlTree.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'datastructures/stlTree.cpp')
-rw-r--r--datastructures/stlTree.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/datastructures/stlTree.cpp b/datastructures/stlTree.cpp
index a20b0dc..6dde73a 100644
--- a/datastructures/stlTree.cpp
+++ b/datastructures/stlTree.cpp
@@ -2,11 +2,13 @@
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std; using namespace __gnu_pbds;
-typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> Tree;
+typedef tree<int, null_type, less<int>, rb_tree_tag,
+ tree_order_statistics_node_update> Tree;
+
int main() {
Tree X;
for (int i = 1; i <= 16; i <<= 1) X.insert(i); // {1, 2, 4, 8, 16}
cout << *X.find_by_order(3) << endl; // => 8
- cout << X.order_of_key(10) << endl; // => 4 = Nachfolger von 10 = minimales i, sodass X[i] >= 10
+ cout << X.order_of_key(10) << endl; // => 4 = min i, mit X[i] >= 10
return 0;
}