January 09, 2025 |169.5K Views

    Introduction of Segment Tree

    Explore Courseexplore course icon
      Share   LikeExplore Courseexplore course icon
    Description
    Discussion

    Segment Tree enables efficient range queries and updates on array intervals. It uses a divide and conquer approach, dividing the array into two parts recursively until single elements are reached. The tree is represented as an array with children of node i at (2*i + 1) and (2*i + 2). Operations like sum, max, GCD, XOR over ranges are performed in O(Log n). It supports dynamic updates while maintaining query efficiency.

    For more details, visit the GeeksforGeeks article: Introduction to Segment Trees.