Questions tagged [range-tree]

A Range Tree is Data Structure that allows fast range queries, such as [4, 5] x [-2, 0]. Use for questions related to implementation/study of this tree.

Sourcing Wikipedia:

A range tree on a set of 1-dimensional points is a balanced binary search tree on those points. The points stored in the tree are stored in the leaves of the tree; each internal node stores the largest value contained in its left subtree. A range tree on a set of points in d-dimensions is a recursively defined multi-level binary search tree. Each level of the data structure is a binary search tree on one of the d-dimensions. The first level is a binary search tree on the first of the d-coordinates. Each vertex v of this tree contains an associated structure that is a (d−1)-dimensional range tree on the last (d−1)-coordinates of the points stored in the subtree of v.

23 questions
1
vote
0 answers

Which data structure should I choose for Orthogonal Range Searching?

I need to solve a neighbor search problem, that is, for every given element, find all neighbor elements within a fixed distance. I just learnt the data structure range tree, it seems to be able to solve this problem in O(N*(log(N)^(d-1))) complexity…
Alaya
  • 3,287
  • 4
  • 27
  • 39
1
vote
0 answers

2D RMQ Range Tree

Hi I'm trying to implement a 2D range tree for rmq-ing, here's my code, i think it's not efficient enough, is there anything i can do for optimation. ls contain list of y sorted on every node rt contain a segment tree p.fi.fi contain x…
zeulb
  • 637
  • 1
  • 7
  • 23
1
vote
1 answer

implement 2d range tree c++

I have been trying to understand range tree for some time, but i still can't understand it. Can someone explain it to me with an implementation, because i want to use it to solve 2D RMQ, i know segment tree, and my teacher tell me range tree is…
zeulb
  • 637
  • 1
  • 7
  • 23
0
votes
1 answer

Memory issue with CGAL RTree when working with 39,651,210 2D points

I am using the CGAL RTree to find 2D points within an interval in a point cloud. The size of the point cloud is 39,651,210 points. However, when I pass these points to the RTree, it causes a massive increase in RAM usage, going from 15 GB to 60 GB…
Dawid
  • 477
  • 3
  • 14
0
votes
1 answer

Nearest point to set of line segments

I have a point p, and n line segments in the 2d space. Is there a way I can preprocess the line segments so that I can efficiently (i.e. sublineraly) find the line segment closest (i.e with lowest perpendicular distance) to P? This is a real-world…
0
votes
0 answers

Find smallest box in a list of boxes that can contain the given item

The problem is as follows: Given a 3d item and a list of 3d boxes, all rectangular cuboids, find the box with the smallest volume that can contain the given item. Only rotations by multiples of 90 degrees are allowed. One solution is with the 3d…
0
votes
0 answers

java.lang.StackOverflowError exception on nested objects primitive values in Java Object Serialization

I have RangeTreeIndex and RangeTreeNode class which I'm using to build the index and after inserting 2500 records, after that, I'm trying to save RangeTreeIndex object in the file where I'm receiving StackOverflowError, below is my entire…
0
votes
1 answer

Number of items in an (x,y) interval in (logn)(logn) time

Homework I need to use a data structure + algorithm that returns the number of elements within a range consisting of 2 (x,y) values (i.e. return the number of elements that fall within a rectangular range on an xy plane) in O(logn*logn). I am…
1
2