Multidimensional segment trees can do range queries and updates in logarithmic time

11/03/2018
by   Nabil Ibtehaz, et al.
0

Updating and querying on a range is a classical algorithmic problem with a multitude of applications. The Segment Tree data structure is particularly notable in handling the range query and update operations. A Segment Segment Tree divides the range into disjoint segments and merges them together to perform range queries and range updates elegantly. Although this data structure is remarkably potent for 1-dimensional problems, it falls short in higher dimensions. Lazy Propagation enables the operations to be computed in O(logn) time in single dimension. However, the concept of lazy propagation could not be translated to higher dimensional cases, which imposes a time complexity of O(n^k-1 logn) for operations on k-dimensional data. In this paper, we have made an attempt to emulate the idea of lazy propagation differently so that it can be applied for 2-dimensional cases. Moreover, the proposed modification is capable of performing any general aggregate function similar to the original Segment Tree, and can also be extended to even higher dimensions. Our proposed algorithm manages to perform range queries and updates in O(^2 n) time for a 2-dimensional problem, which becomes O(^d n) for a d-dimensional situation.

READ FULL TEXT
research
01/06/2021

Algorithms and Hardness for Multidimensional Range Updates and Queries

Traditional orthogonal range problems allow queries over a static set of...
research
05/07/2019

Orthogonal Range Reporting and Rectangle Stabbing for Fat Rectangles

In this paper we study two geometric data structure problems in the spec...
research
08/13/2022

Intersection Searching amid Tetrahedra in Four Dimensions

We develop data structures for intersection queries in four dimensions t...
research
07/14/2018

A Simple and Space Efficient Segment Tree Implementation

The segment tree is an extremely versatile data structure. In this paper...
research
10/25/2020

On Updating and Querying Submatrices

In this paper, we study the d-dimensional update-query problem. We provi...
research
10/25/2019

Overlay Indexes: Efficiently Supporting Aggregate Range Queries and Authenticated Data Structures in Off-the-Shelf Databases

Commercial off-the-shelf DataBase Management Systems (DBMSes) are highly...
research
06/07/2023

Maintaining the cycle structure of dynamic permutations

We present a new data structure for maintaining dynamic permutations, wh...

Please sign up or login with your details

Forgot password? Click here to reset