Open In App

Tango Tree Data Structure

Improve
Improve
Like Article
Like
Save
Share
Report

INTRODUCTION:’

Tango Tree is a data structure for efficient dynamic connectivity and range minimum/maximum query on a set of elements. It is a type of balanced binary search tree that uses finger trees as the underlying data structure to achieve fast and efficient operations. The Tango Tree is designed to support both fast insertions and deletions as well as fast minimum/maximum query operations in a dynamic setting.

Some of the key features and advantages of Tango Tree include its efficient time and space complexity, ability to support a wide range of dynamic connectivity and range minimum/maximum query problems, and its versatility as a general-purpose data structure. Tango Tree is also known for its robustness and stability, as it is less likely to degenerate into an unbalanced tree structure compared to other dynamic binary search trees.

Tango Tree is an online algorithm. It is a type of binary search tree. It is better than the offline weight balanced binary search tree as it achieves a competitive ratio of O(log{ }log{ }n)  as compared to competitive ratio of O(log n)  of offline weight balanced binary search tree. It takes only O(log{ }log{ }n)  of additional bits of memory at every node of the tree to increase the performance over weight balanced binary search tree. Tango tree is conceptually a tree of trees as it partitions a binary search tree into preferred paths and non preferred paths and these preferred paths are themselves stored in the form of auxiliary trees. Preferred child and Preferred Paths Preferred child of any node of Tango tree is defined as the most recently touched child by a normal binary search tree lookup technique. Elaborating more on preferred child let us assume a subtree T rooted at node n with right child as p and left child as q. Call p as the preferred child of n if most recently accessed node of subtree rooted at n is present in the subtree rooted at p. A Preferred path is defined as the path starting from root node and following all the preferred children along a path to reach a leaf node.

tree_

Tango Tree

Auxiliary Trees for Preferred Paths A preferred path is represented by storing the nodes of the preferred path in a balanced binary search tree specifically red black tree. Then, for every non-leaf node of path P there is a non-preferred child q  . This non preferred child acts as the root of the new auxiliary tree and then attach this new auxiliary tree rooted at q  to its parent and in this way, it is easy to link the auxiliary trees together. There is also option to store some extra information in each node of the auxiliary tree as per our own needs like minimum depth of the nodes in the subtree below it, etc. Operations on Tango Tree The two most common operations on Tango Trees are Searching and Updating

  • Updating in a Tango Tree
    1. Cut process
    2. Join process
  • Searching in a tango tree

ADVANTAGES OR DISADVANTAGES:
Advantages of Tango Tree:

  1. Efficiency: Tango Tree provides fast and efficient dynamic connectivity and range minimum/maximum query operations, with an average time complexity of O(log n) for most operations.
  2. Dynamic: Tango Tree is a dynamic data structure that can handle insertions and deletions of elements in real-time, making it suitable for growing and changing datasets.
  3. Balancing: Tango Tree uses finger trees as the underlying data structure, which ensures a balanced tree structure, reducing the risk of degeneration and maintaining efficient time complexity.
  4. Versatility: Tango Tree is a general-purpose data structure that can be used for a wide range of dynamic connectivity and range minimum/maximum query problems.
  5. Robustness: Tango Tree is known for its robustness and stability, as it is less likely to degenerate into an unbalanced tree structure compared to other dynamic binary search trees.

Disadvantages of Tango Tree:

  1. Complexity: Tango Tree is a complex data structure that requires a deeper understanding of the underlying finger trees and balanced binary search trees to implement and use effectively.
  2. Overhead: Tango Tree requires a significant amount of overhead in terms of memory and processing power, making it less suitable for resource-constrained environments.
  3. Limited usage: Tango Tree is designed specifically for dynamic connectivity and range minimum/maximum query problems, making it less suitable for other types of data structures and algorithms.

Last Updated : 01 Feb, 2023
Like Article
Save Article
Previous
Next
Share your thoughts in the comments