Skip to content

feat: add lazy segment tree implementation#3119

Open
YassaTalaat80 wants to merge 2 commits intoTheAlgorithms:masterfrom
YassaTalaat80:feat/lazy-segment-tree
Open

feat: add lazy segment tree implementation#3119
YassaTalaat80 wants to merge 2 commits intoTheAlgorithms:masterfrom
YassaTalaat80:feat/lazy-segment-tree

Conversation

@YassaTalaat80
Copy link
Copy Markdown

Description

This PR adds a implementation of a Lazy Segment Tree to the data_structures directory. It supports range updates and range queries in O(log N) time using lazy propagation.

Changes Made:

  • Implemented a templated LazySegmentTree class to support various data types
  • Added a Node struct to safely encapsulate segment values and lazy flags.
  • Included comprehensive automated tests using assert() to verify build, update, and query operations.

Testing

  • Code compiled successfully...
  • Formatted code...
  • All automated self-tests passed locally.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant