You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+2-3Lines changed: 2 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -15,7 +15,6 @@ A C++ header only interval tree implementation, which takes a red black tree as
15
15
16
16
## Example
17
17
```C++
18
-
#defineINTERVAL_TREE_SAFE_INTERVALS // makes sure that upper_bound > lower_bound (by swapping if neccessary), but is slower. Will become an assert if left out.
19
18
// #include "draw.hpp" // to draw tree. this is not header only anymore.
20
19
#include"interval_tree.hpp"
21
20
@@ -26,7 +25,7 @@ int main()
26
25
// interval_tree <interval <int>>;
27
26
interval_tree_t <int> tree;
28
27
29
-
tree.insert({16, 21});
28
+
tree.insert(make_safe_interval<int>(21, 16)); // make_safe_interval swaps low and high if not in right order.
30
29
tree.insert({8, 9});
31
30
tree.insert({25, 30});
32
31
tree.insert({5, 8});
@@ -335,4 +334,4 @@ Overlapping intervals have 0 distance.
0 commit comments