diff --git a/range_queries/persistent_segment_tree_with_lazy_propagation.cpp b/range_queries/persistent_segment_tree_with_lazy_propagation.cpp index 47ed5922a..cb7acfb35 100644 --- a/range_queries/persistent_segment_tree_with_lazy_propagation.cpp +++ b/range_queries/persistent_segment_tree_with_lazy_propagation.cpp @@ -1,7 +1,6 @@ #include #include - // query -> range sum class perSegTree { private: @@ -26,7 +25,6 @@ private: *newNode = *curr; return newNode; } - void lazy(int i, int j, Node *curr) { if (!curr->prop) { return; @@ -103,7 +101,7 @@ public: n = 0; } - void construct(std::vector vec) // the segment tree will be built from the values in "vec", "vec" is 0 indexed + void construct(const std::vector vec) // the segment tree will be built from the values in "vec", "vec" is 0 indexed { if (vec.empty()) { return; @@ -178,4 +176,5 @@ int main() { std::cout << "Number of segment trees (versions) now = " << tree.size() << '\n'; std::cout << "Querying range sum on version 0 from index 3 to 5 = 11-2+7 = " << tree.query(3, 5, 0) << '\n'; std::cout << "Querying range sum on version 1 from index 3 to 5 = 4-9+0 = " << tree.query(3, 5, 1) << '\n'; + return 0; } \ No newline at end of file