Open In App

Tango Tree Data Structure

Last Updated : 01 Feb, 2023
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.

Similar Reads

Static Data Structure vs Dynamic Data Structure
Data structure is a way of storing and organizing data efficiently such that the required operations on them can be performed be efficient with respect to time as well as memory. Simply, Data Structure are used to reduce complexity (mostly the time complexity) of the code. Data structures can be two types : 1. Static Data Structure 2. Dynamic Data
4 min read
Merge Sort Tree with point update using Policy Based Data Structure
A Merge Sort Tree (MST) is a data structure that allows for efficient querying of the number of elements less than or equal to a certain value in a range of an array. It is built using a divide-and-conquer approach similar to the merge sort algorithm, where the array is recursively divided into two halves and a tree is constructed to represent the
7 min read
AVL Tree Data Structure
An AVL tree defined as a self-balancing Binary Search Tree (BST) where the difference between heights of left and right subtrees for any node cannot be more than one. The difference between the heights of the left subtree and the right subtree for any node is known as the balance factor of the node. The AVL tree is named after its inventors, Georgy
3 min read
Applications of tree data structure
What is Tree Data Structure?A tree is a type of data structure that represents a hierarchical relationship between data elements, called nodes. The top node in the tree is called the root, and the elements below the root are called child nodes. Each child node may have one or more child nodes of its own, forming a branching structure. The nodes at
4 min read
Introduction to Splay tree data structure
Splay tree is a self-adjusting binary search tree data structure, which means that the tree structure is adjusted dynamically based on the accessed or inserted elements. In other words, the tree automatically reorganizes itself so that frequently accessed or inserted elements become closer to the root node. The splay tree was first introduced by Da
15+ min read
Tree Data Structure
Tree Data Structure is a non-linear data structure in which a collection of elements known as nodes are connected to each other via edges such that there exists exactly one path between any two nodes. Table of Content What is Tree Data Structure?Terminologies In Tree Data StructureTypes of Tree Data StructureApplications of Tree Data StructureBasic
7 min read
Introduction to Finger search tree Data Structure
A finger search tree is a data structure that is designed to allow for efficient search and access of data in a set or a sequence. It is a type of binary search tree that uses a "finger" or a reference to a particular element in the tree to quickly find and retrieve other elements. In this article, we will explore the types, advantages, disadvantag
15+ min read
Binary Tree Data Structure
A Binary Tree Data Structure is a hierarchical data structure in which each node has at most two children, referred to as the left child and the right child. It is commonly used in computer science for efficient storage and retrieval of data, with various operations such as insertion, deletion, and traversal. Introduction: Introduction to Binary Tr
4 min read
Introduction to Tree Data Structure
Tree data structure is a specialized data structure to store data in hierarchical manner. It is used to organize and store data in the computer to be used more effectively. It consists of a central node, structural nodes, and sub-nodes, which are connected via edges. We can also say that tree data structure has roots, branches, and leaves connected
15+ min read
Is array a Data Type or Data Structure?
What is Data Type? In computer programming, a data type is a classification of data that determines the type of values that can be stored, manipulated, and processed. It tells the computer what kind of data a particular variable or constant can hold, and what operations can be performed on that data. Common data types include integers, floating-poi
8 min read