Working of a Range Tree

A range tree is made recursively. A BST(Binary Search Tree) on a dimension of points constitutes one level of a range tree and this is done until all the points are addressed which means the first level of the range tree is the BST of the first dimension of points and so on.

Each node of the tree has two information in it: 

  • The range of points for which the node is responsible.
  • The maximum value of a point in the range of node.

To address a range query, recursive traversal of the tree is done. The interval of query is compared to the range of each node in the tree. If the  interval intersects the range of node, then the maximum value of the node’s range is reported and if this is not the case then the traversal is continued on next dimension of the query interval which is the child node.

Exploring Range Trees

While learning data structures we come across various types of data structures ranging from data structures like arrays to slightly difficult data structures like graphs and their various subcategories. One of which is the type of data structure that we are going to discuss today “Range Trees”.

Similar Reads

What are range queries and range trees?

Before moving on with the Range Trees let us first discuss the range queries that are addressed in a very efficient manner by the range trees....

Working of a Range Tree:

A range tree is made recursively. A BST(Binary Search Tree) on a dimension of points constitutes one level of a range tree and this is done until all the points are addressed which means the first level of the range tree is the BST of the first dimension of points and so on....

Operations on Range Trees:

The various operations of the range trees are-...

Illustration of Range Tree:

A Range tress is a balanced BST in which at any node, the left sub-tree will have the values less than or equal to the node value and in the right tree the value is greater than the node value and with this the tree is traversed and the range query is addressed...

Applications of Range Trees:

Spatial Indexing: Range trees can be employed in indexing of points in space and solving various spatial problems like closest pair query, window query. Computational Geometry: Range Trees can be used to address various types of computational geometry related problems like finding MSTs of a set of data points. Statistical Analysis: Range trees can also be used for statistical problems which may include finding the minimum or maximum of a data set or computing the average of a set of points....

Limitation of Range Trees:

Range Trees can only be employed for range queries. Range Trees are not efficient in case of some queries like nearest neighbours queries. Range Trees are difficult to implement in comparison to other data structures....